-
Notifications
You must be signed in to change notification settings - Fork 14
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
Use fixed architecture names in toolchain wrapper #43
Conversation
`uname -m` seems to not be available in some sandboxed environments. This error only occurred after an hour of CI tests on the main opentitan repo.
Follow-up to #42 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will approve to unblock but I just want to point out that an alternative approach would be to use bazel to create those files with a template. This would scale better.
Thanks for the approval and also the suggestion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -4,7 +4,7 @@ | |||
# SPDX-License-Identifier: Apache-2.0 | |||
|
|||
PROG=${0##*/} | |||
TOOLCHAIN="lowrisc_rv32imcb_$(uname -m)_files" | |||
TOOLCHAIN="lowrisc_rv32imcb_aarch64_files" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be nice if there was a way for bazel to pass this env var in as part of the tool configuration. I did a bit of looking, but I didn't see anything obvious.
I'm also a bit surprised that uname
is not available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep that surprised me too. There were only a few specific sandbox environments where it failed to find uname
.
= note: external/crt/toolchains/lowrisc_rv32imcb/wrappers/clang: line 7: uname: command not found
external/crt/toolchains/lowrisc_rv32imcb/wrappers/clang: line 13: /home/runner/.cache/bazel/_bazel_runner/009b5905a925a435539a99f3bc28ac3e/sandbox/processwrapper-sandbox/2923/execroot/lowrisc_opentitan/external/lowrisc_rv32imcb__files/bin/riscv32-unknown-elf-clang: No such file or directory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is possible to pass environment variables to tools as part of the toolchain configuration but unfortunately it is a rather non-trivial change because it requires to use env_set
and env_entry
which we have no reified in the crt (I do have a patch for that but it's quite useless at this point since we do not use the crt for upstream). If you really do need it I can make a PR for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if the issue is that PATH
is hidden by Bazel so non-builtin commands will not work at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think let's merge and release this and we can investigate the uname
issue later if it becomes an issue
uname -m
seems to not be available in some sandboxed environments. This error only occurred after an hour of CI tests on the main opentitan repo.