Passing file to .bazelrc using --action_env
See original GitHub issueI have a file called lsan.supp that I want to pass to .bazelrc so that it is loaded every time bazel --config=asan
is called.
It is in the same directory and means that some memory leak errors are ignored as test failures.
build:asan --copt=-fsanitize=address --copt=-fno-omit-frame-pointer --linkopt=-fsanitize=address --action_env=LSAN_OPTIONS=suppressions=lsan.supp
This gives me the error:
AddressSanitizer: failed to read suppressions file 'lsan.supp'
when I call bazel --config=asan
from another directory.
Is there a way to provide this path to .bazelrc in such a way that it is resolved correctly.
Thanks for your help
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Commands and Options | Bazel
This option takes an argument which is to be passed to the compiler for source files that are compiled in the host configuration....
Read more >How to pass variables to Bazel target build? - Stack Overflow
The user manual page for bazel shows how to use these files, and the use of the --workspace_status_command to populate them. For setting ......
Read more >bazelrc - Google Git
TensorFlow Bazel configuration file. # This file tries to group and simplify build options for TensorFlow. #. # ----CONFIG OPTIONS----. # Android options:....
Read more >How to Bazel pass environment variables - Kevin Simper
You can pass environment variables with "--action_env", an example is here bazel build //:myproject --action_env=MYENV=myvalue.
Read more >How to set xcode version for a project - Google Groups
Is there a way to avoid having to pass --xcode_version=7.3.1 --ios_sdk_version=9.3 to bazel ... You can probably put those commands in your ~/.bazelrc...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
There are other options that resolve
%workspace%
to your project directory, but--action_env
isn’t one of them. We might be able to add that capability to--action_env
, looping in @aehlig for opinions on that.I’m actually surprised it’s ever working for you, since lsan.supp wouldn’t exist in the execution root (never mind the sandbox) unless you’re specifying it as a dependency of your C++ rules. If you are, as a workaround, you could give the absolute path.
I have the same issue. Use %workspace% as file path prefix does not work. Any progress on this FR?