-
-
Notifications
You must be signed in to change notification settings - Fork 166
Running Package Builds with OSH
Samuel Hierholzer edited this page May 17, 2025
·
5 revisions
This document describes issues and notes on running OSH as Shell replacement in package building (either as /bin/bash and/or /bin/sh)
Oily Nixpkgs is an attempt at replacing bash
with Oils in the stdenv
.
Bugs/incompatibilities with nixpkgs (closed means it's fixed. TODO means there is a workaround in place)
- zulip, PR -
"${a[@]+default}"
doesn't properly expand as bash - zulip, commit -
${mystr[@]}
errors (e.g. it's a string) are often silent in bash - zulip, commit -
:&
and;;&
in acase
statement are missing in Oils - zulip, commit -
export x; x=(a b c)
fails as only strings can be exported - zulip -
let
is not implemented- Workaround
(( EXPR )) | true
, path in oily-nixpkgs
- Workaround
- zulip, zulip thread - Oils requires quotes in certain assoc array expansions, e.g.
${myarr[a]-}
needs to be${myarr['a']}
in Osh. See also blog post- patch in oily-nixpkgs
-
[[ -v assoc[arr] ]]
failed silently. Fixed but need to find link in zulip - zulip, gh issue, certain
[[ ... =~ ... ]]
are a syntax err in Oils - zulip, commit
if (( )); then
doesn't work on bash- sane alternative:
if (( 0 ));
- sane alternative:
- zulip -
(( a ) b )
is parsed as arithmetic in Osh ending in a syntax err instead of as nested subshells- Wontfix. added to known differences
- patch in oily-nixpkgs
-
zulip Bug with
IFS=\
- TODO (fixed with
check_ifs_backshlash_broken=:
- TODO (fixed with
- zulip
read -u $FD
is not implemented (fix:read <&$FD
) - zulip commit nested
make
in different directory fails withDirectory not found
Oily Pine is an attempt at replacing /bin/sh
and /bin/bash
with Oils using the package in testing which provides packages oils-for-unix-binsh
and oils-for-unix-bash
.
Bugs/incompatibilities with nixpkgs (closed means it's fixed. TODO means there is a workaround in place)
- zulip commit Repro of nested
make
in different directory fails withDirectory not found
found in nixpkgs - zulip
=word
is a parsing error in OSH (should return=word command not found
when executed -shopt -s strict_eval
should be ysh only)
Related: Running ble.sh with OSH