Skip to content

Conversation

Septa2112
Copy link
Contributor

@Septa2112 Septa2112 commented Aug 4, 2025

Issue

Now running ./build_llvm.sh will cause an issue: ./build_llvm.sh: 17: source: not found.

Because the script is executed with the system default shell (sh), which does not support the source command used in the script, it will cause the Python virtual environment not to activate actually.

How to Fix

The script should either be explicitly run using bash (e.g., bash ./build_llvm.sh) or the script itself should specify bash as the default shell by adding the shebang line #!/usr/bin/env bash at the top.

My improvements:

  • Updated the README.
  • Modified the shebang line.
  • Added set -e to make the script exit immediately if any command fails.

@@ -1,8 +1,10 @@
#!/bin/sh
#!/usr/bin/env bash
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no doubt that this can solve the problem. However, #!/bin/bash is commonly used in bash scripts within this project. It is difficult not to consider whether we should apply this modification to all other bash scripts to prevent similar default shell issues.

Personally, I believe the best approach is to verify the default shell and set it to bash when preparing the environment.

## identify available shells.
$ cat /etc/shells

## verify current default shell
$ echo "$SHELL"

## change the default shell.
$ chsh -s /path/to/new/shell

@yamt
Copy link
Collaborator

yamt commented Aug 5, 2025

@Septa2112 does #4541 fix the issue for your env?

@Septa2112
Copy link
Contributor Author

@yamt yes, it works for my env. And your changes are cleaner and more reasonable. I'm considering closing my PR and adopting yours.

@lum1n0us lum1n0us closed this Aug 6, 2025
@yamt
Copy link
Collaborator

yamt commented Aug 6, 2025

@yamt yes, it works for my env. And your changes are cleaner and more reasonable. I'm considering closing my PR and adopting yours.

thank you for confirmation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants