*** Running test-and-or (command.AndOr children:[ (C (w )) (C (w ) (w (DQ ($ VSub_At)))) (C (w ) (w (DQ ))) ] ops:[ ] ) (command.AndOr children:[ (C (w )) (C (w ) (w (word_part.Splice blame_tok: var_name:ARGV)) ) (C (w ) (w (DQ ))) ] ops:[ ] ) ls && echo @ARGV || die "foo" OK OK test-and-or *** Running test-args-for-loop (command.ForEach keyword: iter_names:[x] iterable:(for_iter.Args) body:(command.DoGroup left: children:[(C (w ) (w ($ x)))] right: ) ) (command.ForEach keyword: iter_names:[x] iterable:(for_iter.Words words:[(w (word_part.Splice blame_tok: var_name:ARGV))] ) body:(BraceGroup left: children:[(C (w ) (w ($ x)))] right: ) ) for x in @ARGV { echo $x } OK (command.ForEach keyword: iter_names:[x] iterable:(for_iter.Args) body:(command.DoGroup left: children:[(C (w ) (w ($ x)))] right: ) ) (command.ForEach keyword: iter_names:[x] iterable:(for_iter.Words words:[(w (word_part.Splice blame_tok: var_name:ARGV))] ) body:(BraceGroup left: children:[(C (w ) (w ($ x)))] right: ) ) for x in @ARGV { echo $x } OK OK test-args-for-loop *** Running test-backticks-TODO (C (w ) (w (CommandSub left_token: child:(C (w ) (w ) (w (${ VSub_Name var))) right: ) ) ) (C (w ) (w (CommandSub left_token: child:(C (w ) (w ) (w (${ VSub_Name var))) right: ) ) ) echo $(echo hi ${var}) OK (C (w ) (w (CommandSub left_token: child:(BraceGroup left: children:[ (command.Sentence child:(C (w ) (w )) terminator: ) ] right: ) right: ) ) ) (C (w ) (w (CommandSub left_token: child:(BraceGroup left: children:[ (command.Sentence child:(C (w ) (w )) terminator: ) ] right: ) right: ) ) ) echo $({ echo hi; }) OK (C (w ) (w (CommandSub left_token: child:(BraceGroup left: children:[ (command.Sentence child:(C (w ) (w )) terminator: ) ] right: ) right: ) ) ) echo $(do { echo hi) OK OK test-backticks-TODO *** Running test-bare-assign-TODO (command.ShAssignment left: rhs:(SQ "") ) setvar a = '' OK (command.ShAssignment left: rhs:(SQ b) ) setvar a = 'b' OK (command.ShAssignment left: child:(C (w )) right: ) ) ) ] ) (Mutation keyword: lhs:[] op: child:(C (w )) right: ) ) setvar a = $(hostname) OK (command.ShAssignment left: name_tok: var_name:PATH suffix_op:(suffix_op.Unary op: arg_word:(w)) right: ) ) ) ] ) (Mutation keyword: lhs:[] op: name_tok: var_name:PATH suffix_op:(suffix_op.Unary op: arg_word:(w)) right: ) ) setvar a = ${PATH:-} OK OK test-bare-assign-TODO *** Running test-brace-group (BraceGroup left: children:[ (command.Sentence child:(C (w ) (w )) terminator: ) ] right: ) do { echo hi; } OK (BraceGroup left: children:[ (command.Sentence child:(C (w ) (w )) terminator: ) (command.Sentence child:(C (w ) (w )) terminator: ) ] right: ) do { echo hi; echo bye; } OK OK test-brace-group *** Running test-bracket-builtin (command.AndOr children:[ (C (w ) (w ) (w ) (w (DQ ($ foo))) (w ) ) (C (w )) ] ops:[] ) (command.AndOr children:[ (C (w ) (w ) (w ) (w ($ foo))) (C (w )) ] ops:[] ) test ! -z $foo || die OK (command.AndOr children:[ (C (w ) (w )) (C (w )) ] ops:[] ) (command.AndOr children:[ (C (w ) (w )) (C (w )) ] ops:[] ) [ ] || die OK (command.If if_kw: arms:[ (IfArm keyword:...0x7f7979387670 cond:(List_of_command (command.Sentence child:(C (w ) (w (DQ ($ foo))) (w ) (w ) (w ) ) terminator: ) ) then_kw: action:[(C (w ) (w ))] then_tok:...0x7f7979387ad0 ) ] else_action:[] fi_kw: ) (command.If if_kw: arms:[ (IfArm keyword:...0x7f4d1c5fb670 cond:(List_of_command (C (w ) (w ($ foo)) (w ) (w ) ) ) action:[(C (w ) (w ))] ) ] else_action:[] ) if test $foo -eq 3 { echo yes } OK OK test-bracket-builtin *** Running test-case (command.Case case_kw: to_match:(case_arg.Word w:(w ($ var))) arms_start: arms:[ (CaseArm left: pattern:(pat.Words words:[(w ) (w )]) middle: action:[ (command.AndOr children:[ (C (w ) (w ) (w ) (w ) ) (C (w ) (w )) ] ops:[] ) ] right: ) (CaseArm left: pattern:(pat.Words words:[(w (DQ))]) middle: action:[(C (w ) (w ))] right: ) (CaseArm left: pattern:(pat.Words words:[(w )]) middle: action:[(C (w ) (w ))] right: ) ] arms_end: ) (command.Case case_kw: to_match:(case_arg.YshExpr e:(Var var)) arms_start: arms:[ (CaseArm left: pattern:(pat.Words words:[(w ) (w )]) middle: action:[ (command.AndOr children:[ (C (w ) (w ) (w )) (C (w ) (w )) ] ops:[] ) ] right: ) (CaseArm left: pattern:(pat.Words words:[(w (DQ))]) middle: action:[(C (w ) (w ))] right: ) (CaseArm left: pattern:(pat.Words words:[(w )]) middle: action:[(C (w ) (w ))] right: ) ] arms_end: ) case (var) { foo|bar { test -f foo && echo file } "" { echo empty } * { echo default } } OK (command.Case case_kw: to_match:(case_arg.Word w:(w (DQ ($ var)))) arms_start: arms:[ (CaseArm left: pattern:(pat.Words words:[(w )]) middle: action:[ (C (w ) (w )) (C (w ) (w )) ] ) ] arms_end: ) (command.Case case_kw: to_match:(case_arg.YshExpr e:(Var var)) arms_start: arms:[ (CaseArm left: pattern:(pat.Words words:[(w )]) middle: action:[ (C (w ) (w )) (C (w ) (w )) ] right: ) ] arms_end: ) case (var) { * { echo foo echo bar # no dsemi } } OK OK test-case *** Running test-command-sub (C (w ) (w (CommandSub left_token: child:(C (w ) (w )) right: ) ) ) (C (w ) (w (CommandSub left_token: child:(C (w ) (w )) right: ) ) ) echo $(echo hi) OK (C (w ) (w (DQ (CommandSub left_token: child:(C (w ) (w )) right: ) ) ) ) (C (w ) (w (DQ (CommandSub left_token: child:(C (w ) (w )) right: ) ) ) ) echo "__$(echo hi)__" OK OK test-command-sub *** Running test-dollar-at (C (w ) (w ) (w (DQ ($ VSub_At))) (w ) ) (C (w ) (w ) (w (word_part.Splice blame_tok: var_name:ARGV)) (w ) ) echo one @ARGV two OK OK test-dollar-at *** Running test-empty-for-loop (command.ForEach keyword: iter_names:[x] iterable:(for_iter.Words words:[]) body:(command.DoGroup left: children:[(C (w ) (w ($ x)))] right: ) ) (command.ForEach keyword: iter_names:[x] iterable:(for_iter.Words words:[]) body:(BraceGroup left: children:[(C (w ) (w ($ x)))] right: ) ) for x in { echo $x } OK OK test-empty-for-loop *** Running test-for-loop (command.ForEach keyword: iter_names:[x] iterable:(for_iter.Words words:[ (w ) (w ) (w ) (w ) (w ) (w ) ] ) semi_tok: body:(command.DoGroup left: children:[(C (w ) (w ($ x)))] right: ) ) (command.ForEach keyword: iter_names:[x] iterable:(for_iter.Words words:[ (w ) (w ) (w ) (w ) (w ) (w ) ] ) body:(BraceGroup left: children:[(C (w ) (w ($ x)))] right: ) ) for x in a b c \ d e f { echo $x } OK (command.ForEach keyword: iter_names:[x] iterable:(for_iter.Words words:[ (w ) (w ) (w ) (w ) (w ) (w ) ] ) body:(command.DoGroup left: children:[(C (w ) (w ($ x)))] right: ) ) (command.ForEach keyword: iter_names:[x] iterable:(for_iter.Words words:[ (w ) (w ) (w ) (w ) (w ) (w ) ] ) body:(BraceGroup left: children:[(C (w ) (w ($ x)))] right: ) ) for x in a b c \ d e f { echo $x } OK OK test-for-loop *** Running test-here-doc (command.Simple blame_tok: more_env:[] words:[(w )] is_last_cmd:F redirects:[ (Redir op: loc:(redir_loc.Fd fd:0) arg:(redir_param.HereDoc here_begin:(w ) here_end_tok: stdin_parts:[] ) ) ] ) (command.Simple blame_tok: more_env:[] words:[(w )] is_last_cmd:F redirects:[ (Redir op: loc:(redir_loc.Fd fd:0) arg:(redir_param.HereWord w:(w (DoubleQuoted left: parts:[] right: ) ) is_multiline:T ) ) ] ) cat <<< """ hi """ OK (command.Simple blame_tok: more_env:[] words:[(w )] is_last_cmd:F redirects:[ (Redir op: loc:(redir_loc.Fd fd:0) arg:(redir_param.HereDoc here_begin:(w (SQ EOF)) here_end_tok: stdin_parts:[] ) ) ] ) (command.Simple blame_tok: more_env:[] words:[(w )] is_last_cmd:F redirects:[ (Redir op: loc:(redir_loc.Fd fd:0) arg:(redir_param.HereWord w:(w (SingleQuoted left: sval:"hi\n" right: ) ) is_multiline:T ) ) ] ) cat <<< ''' hi ''' OK OK test-here-doc *** Running test-if (command.If if_kw: arms:[ (IfArm keyword:...0x7fa142f88670 cond:(List_of_command (command.Sentence child:(C (w )) terminator: ) ) then_kw: action:[(C (w ) (w ))] then_tok:...0x7fa142f88830 ) ] else_action:[] fi_kw: ) (command.If if_kw: arms:[ (IfArm keyword:...0x7fc1fce6a670 cond:(List_of_command (C (w ))) action:[(C (w ) (w ))] ) ] else_action:[] ) if true { echo yes } OK (command.If if_kw: arms:[ (IfArm keyword:...0x7faf95c89670 cond:(List_of_command (command.Sentence child:(C (w )) terminator: ) ) then_kw: action:[(C (w ) (w ))] then_tok:...0x7faf95c89830 ) (IfArm keyword: cond:(List_of_command (command.Sentence child:(C (w )) terminator: ) ) then_kw: action:[(C (w ) (w ))] then_tok:...0x7faf95c89b40 ) (IfArm keyword: cond:(List_of_command (command.Sentence child:(C (w )) terminator: ) ) then_kw: action:[(C (w ) (w ))] then_tok:...0x7faf95c89e50 ) ] else_kw: else_action:[(C (w ) (w ))] fi_kw: ) (command.If if_kw: arms:[ (IfArm keyword:...0x7f3db3d79670 cond:(List_of_command (C (w ))) action:[(C (w ) (w ))] ) (IfArm keyword: cond:(List_of_command (C (w ))) action:[(C (w ) (w ))] ) (IfArm keyword: cond:(List_of_command (C (w ))) action:[(C (w ) (w ))] ) ] else_action:[(C (w ) (w ))] ) if true { echo yes } elif false { echo elif } elif spam { echo elif } else { echo no } OK (command.Redirect child:(command.If if_kw: arms:[ (IfArm keyword:...0x7fdc0f30a670 cond:(List_of_command (command.Sentence child:(C (w )) terminator: ) ) then_kw: action:[(C (w ) (w ))] then_tok:...0x7fdc0f30a830 ) ] else_action:[] fi_kw: ) redirects:[ (Redir op:"> loc:(redir_loc.Fd fd:1) arg:(w )) ] ) (command.Redirect child:(command.If if_kw: arms:[ (IfArm keyword:...0x7f9e94336670 cond:(List_of_command (C (w ))) action:[(C (w ) (w ))] ) ] else_action:[] ) redirects:[ (Redir op:"> loc:(redir_loc.Fd fd:1) arg:(w )) ] ) if true { echo yes } > out OK OK test-if *** Running test-ksh-func (ShFunction keyword: name_tok: name:func1 body:(BraceGroup left: children:[(C (w ) (w ))] right: ) code_str:"function func1 { # no parens\n echo func1\n}" ) (Proc keyword: name: sig:(proc_sig.Open) body:(BraceGroup left: children:[(C (w ) (w ))] right: ) ) proc func1 { # no parens echo func1 } OK OK test-ksh-func *** Running test-line-breaks (C (w ) (w ) (w ) (w ) (w ) ) (C (w ) (w ) (w ) (w ) (w ) ) echo one \ two three \ four OK OK test-line-breaks *** Running test-posix-func (ShFunction name_tok: name:f body:(BraceGroup left: children:[(C (w ) (w (DQ )))] right: ) code_str:"f() {\n echo \"hi\"\n }" ) (Proc keyword: name: sig:(proc_sig.Open) body:(BraceGroup left: children:[(C (w ) (w (DQ )))] right: ) ) proc f { echo "hi" } OK (ShFunction name_tok: name:f body:(BraceGroup left: children:[(C (w ) (w (DQ )))] right: ) code_str:"f()\n {\n echo \"hi\"\n }" ) (Proc keyword: name: sig:(proc_sig.Open) body:(BraceGroup left: children:[(C (w ) (w (DQ )))] right: ) ) proc f { echo "hi" } OK OK test-posix-func *** Running test-simple-command (C (w ) (w )) (C (w ) (w )) echo hi OK OK test-simple-command *** Running test-source-builtin (C (w ) (w )) (C (w ) (w )) source lib.sh OK (command.AndOr children:[ (C (w ) (w ) (w ) (w ) ) (C (w ) (w )) ] ops:[] ) (command.AndOr children:[ (C (w ) (w ) (w )) (C (w ) (w )) ] ops:[] ) test -f lib.sh && source lib.sh OK OK test-source-builtin *** Running test-subshell (command.Subshell left: child:(command.Sentence child:(C (w ) (w )) terminator: ) right: is_last_cmd:F ) shell {echo hi;} OK (command.Subshell left: child:(C (w ) (w )) right: is_last_cmd:F ) shell {echo hi} OK (command.Subshell left: child:(command.CommandList children:[ (command.Sentence child:(C (w ) (w )) terminator: ) (C (w ) (w )) ] ) right: is_last_cmd:F ) shell {echo hi; echo bye} OK (command.Subshell left: child:(command.Subshell left: child:(command.CommandList children:[ (command.Sentence child:(C (w ) (w )) terminator: ) (C (w ) (w )) ] ) right: is_last_cmd:F ) right: is_last_cmd:F ) shell { shell {echo hi; echo bye } } OK OK test-subshell *** Running test-unquote-subs-TODO (C (w ) (w (DQ ($ 1))) (w (DQ ($ foo)))) (C (w ) (w ($ 1)) (w ($ foo))) echo $1 $foo OK (C (w ) (w (DQ (CommandSub left_token: child:(C (w ) (w )) right: ) ) ) ) (C (w ) (w (CommandSub left_token: child:(C (w ) (w )) right: ) ) ) echo $(echo hi) OK OK test-unquote-subs-TODO *** Running test-var-sub (C (w ) (w ($ foo))) (C (w ) (w ($ foo))) echo $foo OK (C (w ) (w ($ foo)) (w (${ VSub_Name bar)) (w (DQ (${ VSub_Name bar) )) ) (C (w ) (w ($ foo)) (w (${ VSub_Name bar)) (w (DQ (${ VSub_Name bar) )) ) echo $foo ${bar} "__${bar}__" OK OK test-var-sub *** Running test-while-loop (command.WhileUntil keyword: cond:(List_of_command (command.Sentence child:(C (w ) (w )) terminator: ) ) body:(command.DoGroup left: children:[(C (w ) (w ($ line)))] right: ) ) (command.WhileUntil keyword: cond:(List_of_command (C (w ) (w ))) body:(BraceGroup left: children:[(C (w ) (w ($ line)))] right: ) ) while read line { echo $line } OK (command.WhileUntil keyword: cond:(List_of_command (command.Sentence child:(C (w ) (w )) terminator: ) ) body:(command.DoGroup left: children:[(C (w ) (w ($ line)))] right: ) ) (command.WhileUntil keyword: cond:(List_of_command (C (w ) (w ))) body:(BraceGroup left: children:[(C (w ) (w ($ line)))] right: ) ) while read \ line { echo $line } OK OK test-while-loop test/ysh-ify.sh: 22 tests passed. #!/usr/bin/env bash # # Build oils-for-unix. # # Usage: # build/native.sh set -o nounset set -o pipefail set -o errexit setvar REPO_ROOT = $(cd "$(dirname $0)/.."; pwd) # tsv-lib.sh uses this source build/common.sh # log source build/dev-shell.sh # python2 # Demo for the oils-for-unix tarball. # Notes: # - Does not rely on Ninja, which is for the dev build # - It shouldn't require 'objcopy' # - TODO: do this in the Soil 'cpp' task proc tarball-demo { setvar translator = ${1:-mycpp} mkdir -p _bin ./configure time _build/oils.sh --translator $translator --skip-rebuild local bin case (translator) { mycpp { setvar bin = "_bin/cxx-opt-sh/oils-for-unix.stripped" } * { setvar bin = "_bin/cxx-opt-sh/$translator/oils-for-unix.stripped" } } ls -l $bin echo echo "You can now run $bin. Example:" echo set -o xtrace # TODO: Use symlink $bin osh -n -c 'echo "hello $name"' } proc measure-build-times { local variant=${1:-opt} mkdir -p _bin ./configure local out_tsv=_tmp/time-tarball-$variant.tsv # Header for functions in build/ninja-rules-cpp.sh benchmarks/time_.py --tsv --out $out_tsv --rusage --print-header --field verb --field out" time TIME_TSV_OUT=$out_tsv" _build/oils.sh --variant $variant echo cat $out_tsv } # # Ninja Wrappers # proc oils-demo { local osh=${1:-bin/osh} export PYTHONPATH='.:vendor/' echo 'echo hi' | bin/osh_parse.py bin/osh_parse.py -c 'ls -l' # Same functionality in bin/oils-for-unix echo 'echo hi' | $osh $osh -n -c 'ls -l' echo --- # ast format is none $osh --ast-format none -n -c 'ls -l' echo '-----' # Now test some more exotic stuff $osh -c '(( a = 1 + 2 * 3 )); echo $a' $osh -c \ 'echo "hello"x $$ ${$} $((1 + 2 * 3)) {foo,bar}@example.com' $osh -c 'for x in 1 2 3; do echo $x; done' } proc soil-run { local osh=_bin/cxx-asan+gcalways/osh local ysh=_bin/cxx-asan+gcalways/ysh ninja $osh $ysh echo $osh --version echo oils-demo $osh # Regression for pnode::PNode* rooting bug in spec/ysh-bugs, which only # manifests with _bin/cxx-asan+gcalways/ysh $ysh -c 'var x = 42; echo $x' } # # Slices # proc slices { # Prepare for Windows / Rust? # This works, but it imports all of core/shell.py local osh_eval=_bin/cxx-asan/bin/osh_eval.mycpp ninja $osh_eval $osh_eval -c 'echo 1; echo 2' # ~400 lines of C++ compile errors - circular dependencies # # I think we need something like mycpp --to-header? # So we can export all the forward declarations ... But maybe we won't use # them? Can we built from the bottom up # # core/vm.py InitUnsafeArith might be an issue local osh_parse=_bin/cxx-asan/bin/osh_parse.mycpp ninja $osh_parse } proc count-slice { # osh_parse.py: 35 files # 22K lines of output # # others: 89 files wc -l \ _build/NINJA/bin.osh_parse/translate.txt \ _build/NINJA/bin.osh_eval/translate.txt \ _build/NINJA/bin.oils_for_unix/translate.txt } proc check-slice { # This type checks # # And we pass a list of files on the mycpp command line. # # I think we need to generate header files though # # core/vm.py if TYPE_CHECKING are an issue - they are not bound by # dynamic_deps.py # # But we should understand them # # Maybe we need to have a pass which computes imports and types: # # cppgen_pass::Decl::visit_import_from() ? # # Or just do the same hack as prebuilt/ for all those headers ... hm OK! devtools/types.sh check-binary bin.osh_parse } proc install-musl { sudo apt-get install musl-tools musl-dev } proc musl-demo { mkdir -p _tmp/musl pushd _tmp/musl echo 'int main() { return 42; }' > foo.c echo ' #include int main() { std::cout << "Hi"; return 42; } ' > cpp.cpp musl-gcc -o foo foo.c # Doesn't work! # https://www.musl-libc.org/faq.html musl-gcc -std=c++11 -o cpp cpp.cpp set +o errexit ./foo echo status=$? ./cpp echo status=$? popd } @ARGV (DONE build/native.sh) # Old shell state, preserved to avoid breaking existing contributors. # # Usage: # . build/old-wedges.sh setvar ROOT_WEDGE_DIR = "/wedge/oils-for-unix.org" # Also in build/deps.sh setvar USER_WEDGE_DIR = "~/wedge/oils-for-unix.org" readonly WEDGE_PY2_DIR=$ROOT_WEDGE_DIR/pkg/python2/2.7.18/bin if test -d $WEDGE_PY2_DIR { setvar PATH = ""$WEDGE_PY2_DIR:$PATH"" } readonly WEDGE_PY3_DIR=$ROOT_WEDGE_DIR/pkg/python3/3.10.4/bin if test -d $WEDGE_PY3_DIR { setvar PATH = ""$WEDGE_PY3_DIR:$PATH"" } readonly WEDGE_RE2C_DIR=$ROOT_WEDGE_DIR/pkg/re2c/3.0/bin if test -d $WEDGE_RE2C_DIR { setvar PATH = ""$WEDGE_RE2C_DIR:$PATH"" } readonly UFTRACE_WEDGE_DIR=$ROOT_WEDGE_DIR/pkg/uftrace/0.13/bin if test -d $UFTRACE_WEDGE_DIR { setvar PATH = ""$UFTRACE_WEDGE_DIR:$PATH"" } # FALLBACK without busybox wedge: test/spec.sh link-busybox-ash readonly ASH_SYMLINK_DIR="$PWD/_tmp/shells" if test -d $ASH_SYMLINK_DIR { setvar PATH = ""$ASH_SYMLINK_DIR:$PATH"" } readonly WEDGE_SOUFFLE_DIR=$USER_WEDGE_DIR/pkg/souffle/2.4.1/bin if test -d $WEDGE_SOUFFLE_DIR { setvar PATH = ""$WEDGE_SOUFFLE_DIR:$PATH"" } # OBSOLETE # This takes precedence over $ASH_SYMLINK_DIR readonly SPEC_DIR="$PWD/../oil_DEPS/spec-bin" if test -d $SPEC_DIR { setvar PATH = ""$SPEC_DIR:$PATH"" } # # Newer spec-bin wedges found before obsolete ../oil_DEPS # readonly BASH_WEDGE_DIR=$USER_WEDGE_DIR/pkg/bash/4.4/bin if test -d $BASH_WEDGE_DIR { setvar PATH = ""$BASH_WEDGE_DIR:$PATH"" } # bash 5 found before bash 4 readonly BASH5_WEDGE_DIR=$USER_WEDGE_DIR/pkg/bash/5.2.21/bin if test -d $BASH5_WEDGE_DIR { setvar PATH = ""$BASH5_WEDGE_DIR:$PATH"" } readonly DASH_WEDGE_DIR=$USER_WEDGE_DIR/pkg/dash/0.5.10.2/bin if test -d $DASH_WEDGE_DIR { setvar PATH = ""$DASH_WEDGE_DIR:$PATH"" } readonly MKSH_WEDGE_DIR=$USER_WEDGE_DIR/pkg/mksh/R52c if test -d $MKSH_WEDGE_DIR { setvar PATH = ""$MKSH_WEDGE_DIR:$PATH"" } readonly ZSH_NEW_WEDGE_DIR=$USER_WEDGE_DIR/pkg/zsh/5.9/bin if test -d $ZSH_NEW_WEDGE_DIR { setvar PATH = ""$ZSH_NEW_WEDGE_DIR:$PATH"" } # Old version comes first readonly ZSH_OLD_WEDGE_DIR=$USER_WEDGE_DIR/pkg/zsh/5.1.1/bin if test -d $ZSH_OLD_WEDGE_DIR { setvar PATH = ""$ZSH_OLD_WEDGE_DIR:$PATH"" } readonly BUSYBOX_WEDGE_DIR=$USER_WEDGE_DIR/pkg/busybox/1.35.0 if test -d $BUSYBOX_WEDGE_DIR { setvar PATH = ""$BUSYBOX_WEDGE_DIR:$PATH"" } readonly YASH_WEDGE_DIR=$USER_WEDGE_DIR/pkg/yash/2.49/bin if test -d $YASH_WEDGE_DIR { setvar PATH = ""$YASH_WEDGE_DIR:$PATH"" } # # R_LIBS_USER # setvar OLD_WEDGE_DIR = "~/wedge/oils-for-unix.org/pkg" if test -d ~/R { # 2023-07: Hack to keep using old versions on lenny.local # In 2023-04, dplyr stopped supporting R 3.4.4 on Ubuntu Bionic # https://cran.r-project.org/web/packages/dplyr/index.html setvar R_LIBS_USER = "~/R" } elif test -d $OLD_WEDGE_DIR/R-libs { setvar R_LIBS_USER = "$OLD_WEDGE_DIR/R-libs/2023-04-18" } # # PYTHONPATH # # Unconditionally add to PYTHONPATH; otherwise build/deps.sh install-wedges # can't work in one shot readonly OLD_PY3_LIBS_WEDGE=$USER_WEDGE_DIR/pkg/py3-libs/$_PY3_LIBS_VERSION/$_SITE_PACKAGES setvar PYTHONPATH = ""$OLD_PY3_LIBS_WEDGE:$PYTHONPATH"" readonly _OLD_MYPY_WEDGE=$USER_WEDGE_DIR/pkg/mypy/$_MYPY_VERSION if test -d $_OLD_MYPY_WEDGE { setvar PYTHONPATH = ""$_OLD_MYPY_WEDGE:$PYTHONPATH"" } (DONE build/old-wedges.sh) Traceback (most recent call last): File "/home/uke/oil/bin/oils_for_unix.py", line 263, in sys.exit(main(sys.argv)) File "/home/uke/oil/bin/oils_for_unix.py", line 232, in main return AppBundleMain(argv) File "/home/uke/oil/bin/oils_for_unix.py", line 198, in AppBundleMain bash_compat=(applet == 'bash')) File "/home/uke/oil/core/shell.py", line 1251, in Main node = main_loop.ParseWholeFile(c_parser) File "/home/uke/oil/core/main_loop.py", line 428, in ParseWholeFile node = c_parser.ParseLogicalLine() # can raise ParseError File "/home/uke/oil/osh/cmd_parse.py", line 2839, in ParseLogicalLine node = self._ParseCommandLine() File "/home/uke/oil/osh/cmd_parse.py", line 2695, in _ParseCommandLine child = self.ParseAndOr() File "/home/uke/oil/osh/cmd_parse.py", line 2619, in ParseAndOr return self._ParseAndOr() File "/home/uke/oil/osh/cmd_parse.py", line 2630, in _ParseAndOr child = self.ParsePipeline() File "/home/uke/oil/osh/cmd_parse.py", line 2578, in ParsePipeline child = self.ParseCommand() File "/home/uke/oil/osh/cmd_parse.py", line 2521, in ParseCommand return self.ParseFunctionDef() # f() { echo; } # function File "/home/uke/oil/osh/cmd_parse.py", line 2172, in ParseFunctionDef func.body = self.ParseCompoundCommand() File "/home/uke/oil/osh/cmd_parse.py", line 2073, in ParseCompoundCommand n1 = self.ParseBraceGroup() File "/home/uke/oil/osh/cmd_parse.py", line 1365, in ParseBraceGroup c_list = self._ParseCommandList() File "/home/uke/oil/osh/cmd_parse.py", line 2823, in _ParseCommandList return self._ParseCommandTerm() File "/home/uke/oil/osh/cmd_parse.py", line 2760, in _ParseCommandTerm child = self.ParseAndOr() File "/home/uke/oil/osh/cmd_parse.py", line 2619, in ParseAndOr return self._ParseAndOr() File "/home/uke/oil/osh/cmd_parse.py", line 2630, in _ParseAndOr child = self.ParsePipeline() File "/home/uke/oil/osh/cmd_parse.py", line 2578, in ParsePipeline child = self.ParseCommand() File "/home/uke/oil/osh/cmd_parse.py", line 2496, in ParseCommand return self.ParseCompoundCommand() File "/home/uke/oil/osh/cmd_parse.py", line 2082, in ParseCompoundCommand return self.ParseFor() File "/home/uke/oil/osh/cmd_parse.py", line 1624, in ParseFor n2 = self._ParseForEachLoop(for_kw) File "/home/uke/oil/osh/cmd_parse.py", line 1598, in _ParseForEachLoop node.body = self.ParseDoGroup() File "/home/uke/oil/osh/cmd_parse.py", line 1385, in ParseDoGroup c_list = self._ParseCommandList() # could be anything File "/home/uke/oil/osh/cmd_parse.py", line 2823, in _ParseCommandList return self._ParseCommandTerm() File "/home/uke/oil/osh/cmd_parse.py", line 2760, in _ParseCommandTerm child = self.ParseAndOr() File "/home/uke/oil/osh/cmd_parse.py", line 2619, in ParseAndOr return self._ParseAndOr() File "/home/uke/oil/osh/cmd_parse.py", line 2630, in _ParseAndOr child = self.ParsePipeline() File "/home/uke/oil/osh/cmd_parse.py", line 2578, in ParsePipeline child = self.ParseCommand() File "/home/uke/oil/osh/cmd_parse.py", line 2554, in ParseCommand return self.ParseSimpleCommand() File "/home/uke/oil/osh/cmd_parse.py", line 1222, in ParseSimpleCommand redirects, words, typed_args, block = self._ScanSimpleCommand() File "/home/uke/oil/osh/cmd_parse.py", line 904, in _ScanSimpleCommand self._GetWord() File "/home/uke/oil/osh/cmd_parse.py", line 670, in _GetWord w = self.w_parser.ReadWord(self.next_lex_mode) File "/home/uke/oil/osh/word_parse.py", line 2329, in ReadWord w = self._ReadWord(word_mode) File "/home/uke/oil/osh/word_parse.py", line 2246, in _ReadWord return self._ReadCompoundOrRedir(lex_mode) File "/home/uke/oil/osh/word_parse.py", line 1894, in _ReadCompoundOrRedir return self._ReadCompoundOrRedir3(lex_mode, Id.Undefined_Tok, True) File "/home/uke/oil/osh/word_parse.py", line 1999, in _ReadCompoundOrRedir3 part = self._ReadUnquotedLeftParts(is_triple_quoted) File "/home/uke/oil/osh/word_parse.py", line 910, in _ReadUnquotedLeftParts dq_part = self._ReadDoubleQuoted(self.cur_token) File "/home/uke/oil/osh/word_parse.py", line 1191, in _ReadDoubleQuoted self._ReadLikeDQ(left_token, False, parts) File "/home/uke/oil/osh/word_parse.py", line 1102, in _ReadLikeDQ part = word_part.EscapedLiteral(tok, "\"") UnboundLocalError: local variable 'tok' referenced before assignment FAIL: build/ref/ovm-actions.sh xargs: test/ysh-ify.sh: exited with status 255; aborting