Skip to content
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

[llvm-lit] The lit internal shell doesn’t support env command without any arguments #102383

Closed
1 task done
Harini0924 opened this issue Aug 7, 2024 · 0 comments · Fixed by #98414
Closed
1 task done
Assignees
Labels

Comments

@Harini0924
Copy link
Contributor

Harini0924 commented Aug 7, 2024

LLVM lit's internal shell displays an error while using the env command on no args:

******************** TEST 'LLVM :: tools/not/disable-symbolization.test' FAILED ********************
Exit Code: 127

Command Output (stdout):
--
# RUN: at line 4
not --crash env > /usr/local/google/home/harinidonthula/llvm-project/build/test/tools/not/Output/disable-symbolization.test.tmp || true
# executed command: not --crash env
# .---command stderr------------
# | Error: 'env' requires a subcommand
# `-----------------------------
# error: command failed with exit status: 127

This error occurs on this # RUN: not --crash env > %t || true in the not/disable-symbolization.test. The test includes a check for environment variables when env is run without arguments. However, the current behavior in the LLVM lit internal shell raises an error instead of displaying the environment variables. The test script is set to check for specific environment variables using the CHECK-DAG commands, expecting the env command to list them when executed without arguments.

file with failure:

  • llvm/test/tools/not/disable-symbolization.test
@EugeneZelenko EugeneZelenko added test-suite llvm-tools All llvm tools that do not have corresponding tag and removed new issue labels Aug 7, 2024
@Harini0924 Harini0924 self-assigned this Aug 25, 2024
Harini0924 added a commit that referenced this issue Aug 29, 2024
…and (#98414)

This patch addresses an issue with lit's internal shell when env is
without any arguments, it fails with exit code 127 because `env`
requires a subcommand. This patch addresses the issue by encoding the
command to properly return environment variables even when no arguments
are provided.

The error occurred when running the command 
` LIT_USE_INTERNAL_SHELL=1 ninja check-llvm`.

fixes: #102383
This is part of the test cleanups proposed in the RFC: [[RFC] Enabling
the Lit Internal Shell by
Default](https://discourse.llvm.org/t/rfc-enabling-the-lit-internal-shell-by-default/80179)
@EugeneZelenko EugeneZelenko added llvm-lit and removed test-suite llvm-tools All llvm tools that do not have corresponding tag labels Aug 29, 2024
@Harini0924 Harini0924 changed the title [llvm-lit] lit internal shell doesn’t support env command without any arguments [llvm-lit] The lit internal shell doesn’t support env command without any arguments Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants