From 5ff3e0ceb1cae6ab5bb19dbf5f5443feb602cc4d Mon Sep 17 00:00:00 2001 From: Michael Greenberg Date: Wed, 3 Jun 2020 10:39:06 -0700 Subject: [PATCH 1/2] add back in fixes to command lookup that were breaking modernish --- src/command.lem | 9 ++++++--- tests/shell/semantics.command.path.test | 3 +++ 2 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 tests/shell/semantics.command.path.test diff --git a/src/command.lem b/src/command.lem index 10ed274..7549d68 100644 --- a/src/command.lem +++ b/src/command.lem @@ -2783,11 +2783,14 @@ let run_command s0 opts checked prog_name argv env = Right (s3, stmt, restore) end | Nothing -> - match check_execve Nothing (* no prefix *) s1 prog with - | (s2, Nothing) -> + let ts0 = push_locals s1 env in + match check_execve Nothing (* no prefix *) ts0 prog with + | (ts1, Nothing) -> + let (s2, _) = pop_locals ts1 in (* failed... and emitted an error message and set the ec *) Right (s2, Done, true) - | (s2, Just executable) -> + | (ts1, Just executable) -> + let (s2, _) = pop_locals ts1 in let cmd = symbolic_string_of_string executable in let exported = exported_set_vars s2 in (* use env to override exports---impl as Pmap.(union) *) diff --git a/tests/shell/semantics.command.path.test b/tests/shell/semantics.command.path.test new file mode 100644 index 0000000..64a974d --- /dev/null +++ b/tests/shell/semantics.command.path.test @@ -0,0 +1,3 @@ +OLDPATH="$PATH" +PATH="" +PATH="$OLDPATH" cat Date: Wed, 3 Jun 2020 11:24:45 -0700 Subject: [PATCH 2/2] ensure there's just one failure in modernish --- .travis.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.travis.yml b/.travis.yml index eeecc09..6cc03d1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -71,6 +71,11 @@ script: - make -C src/ test - TEST_DEBUG=1 TEST_TIMEOUT=15 make -C tests/ test # higher timeout for CI (default is 9s) + # RUN MODERNISH TESTS (WHICH WILL HAVE SOME FAILURES WITH DASH'S PARSER) + - yes n | modernish/install.sh -s smoosh 2>&1 | tee modernish.log || true + - test "$(grep BUG modernish.log)" = ' LOCALVARS TRAPPRSUBSH BUG_MULTIBYTE' || echo "Expected BUG_MULTIBYTE (and no others)" + - test "$(grep FAIL modernish.log | cut -c3,4,5)" = '002' || echo 'Expected ASCII char failure' + # BUILD AND TEST WEB SERVER - (cd web; bundle install) - sh web/src/mk_config.sh $(pwd) >web/src/config.yml