shebang: changed scripts shebang to better support systems like bsd and nixos#306
Closed
lromor wants to merge 1 commit intobazelbuild:mainfrom
Closed
shebang: changed scripts shebang to better support systems like bsd and nixos#306lromor wants to merge 1 commit intobazelbuild:mainfrom
lromor wants to merge 1 commit intobazelbuild:mainfrom
Conversation
|
Nice! This will unbreak systems that behave Posix-correctly and don't have bash in |
4d6035a to
5b11bac
Compare
5b11bac to
f4841a4
Compare
|
What is the review-status here ? This will make life on NixOS much easier. |
trybka
approved these changes
Mar 11, 2025
hzeller
added a commit
to hzeller/fpga-assembler
that referenced
this pull request
Mar 18, 2025
bazelbuild/rules_cc#306 has been merged, so we can use unstable from upstream now. Also, upgrade to latest bant version.
lromor
pushed a commit
to lromor/fpga-assembler
that referenced
this pull request
Mar 18, 2025
bazelbuild/rules_cc#306 has been merged, so we can use unstable from upstream now. Also, upgrade to latest bant version.
13 tasks
hzeller
added a commit
to hzeller/OpenROAD
that referenced
this pull request
Apr 10, 2025
When running the compilation on NixOS, it is not possible currently
to use the llvm_toolchain mentioned in the MODULE.bazel, but necessary
to run the local toolchain (`clangStdenv`). That in turn is strict and
only allows to compile C files when invoked with `clang` and
requires `clang++` or `clang -xc++` to compile C++ files - unlike a typical clang
installation that attempts to auto-detect. But Bazel is lazy and
invokes c++ compilation with `clang` ...
Another issue: the latest rules_cc version has hardcoded paths to
`/bin/bash` while the correct way to use that on Posix systems is to
call it via `/usr/bin/env`.
So, this PR solves both these issues:
* Add `-xc++` to the compiler invocation for cxx compilation.
* Use a rules_cc that has the fix to use /usr/bin/env
(bazelbuild/rules_cc#306), but that
is not released yet on BCR (once 0.1.2 is out we can probably
use that directly).
Signed-off-by: Henner Zeller <hzeller@google.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The assumption that bash is always located at /bin/bash does not always hold true.
In POSIX systems, it is recommended to avoid relying on common paths. Instead, one should either:
A more portable approach is to use
#!/usr/bin/env bash, which resolves binaries through the PATH.This patch updates the default shebang string in this repository to improve portability on systems like NixOS or BSD.