Running Package Builds with OSH - oils-for-unix/oils GitHub Wiki
This document describes issues and notes on running OSH as Shell replacement in package building (either as /bin/bash and/or /bin/sh)
Nixpkgs
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 -
:∧;&in acasestatement are missing in Oils - zulip, commit -
export x; x=(a b c)fails as only strings can be exported - zulip -
letis 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] ](/oils-for-unix/oils/wiki/--v-assoc[arr]-)failed silently. Fixed but need to find link in zulip - zulip, gh issue, certain
[ ... =~ ... ](/oils-for-unix/oils/wiki/-...-=~-...-)are a syntax err in Oils - zulip, commit
if (( )); thendoesn'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 $FDis not implemented (fix:read <&$FD) - zulip commit nested
makein different directory fails withDirectory not found
Alpine
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
makein different directory fails withDirectory not foundfound in nixpkgs - zulip
=wordis a parsing error in OSH (should return=word command not foundwhen executed -shopt -s strict_evalshould be ysh only)
Related: Running ble.sh with OSH