Skip to content

[llvm-lit] Unset command not found in lit internal shell #102397

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 tasks done
Harini0924 opened this issue Aug 7, 2024 · 0 comments · Fixed by #104880
Closed
2 tasks done

[llvm-lit] Unset command not found in lit internal shell #102397

Harini0924 opened this issue Aug 7, 2024 · 0 comments · Fixed by #104880

Comments

@Harini0924
Copy link
Contributor

Harini0924 commented Aug 7, 2024

The unset command is currently not found or implemented in the lit internal shell.
Error displayed

# executed command: unset AFL_DRIVER_STDERR_DUPLICATE_FILENAME
# .---command stderr------------
# | 'unset': command not found
# `-----------------------------
# error: command failed with exit status: 127

Files with failures:

  • compiler-rt/test/fuzzer/afl-driver-close-fd-mask.test
  • compiler-rt/test/fuzzer/afl-driver-stderr.test
cjdb pushed a commit to cjdb/llvm-project that referenced this issue Aug 23, 2024
… in lit internal shell (llvm#104880)

This patch rewrites tests to remove the use of the `unset` command,
which is not supported in the lit internal shell. The tests now use the
`env -u` to unset environment variables.

The `unset` command is used in shell environments to remove the
environment variable. However, because the lit internal shell does not
support the `unset` command, using it in tests would result in errors or
other unexpected behavior. To overcome this limitation, the tests have
been updated to use the `env -u` command instead. `env -u` is supported
by lit and effectively removes specified environment variables. This
allows the tests to achieve the same goal of unsetting environment
variables while ensuring compatibility with the lit internal shell.

This change is relevant for [[RFC] Enabling the Lit Internal Shell by
Default](https://discourse.llvm.org/t/rfc-enabling-the-lit-internal-shell-by-default/80179/3)
Fixes: llvm#102397
@Harini0924 Harini0924 self-assigned this Aug 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants