[bug] Bazel issue when using string value for defines
See original GitHub issueIf define is a string value, there is problem in generated build file.
String in string is generated and Bazel can’t resolve this.
Here is example from generated boost BUILD file:
"BOOST_STACKTRACE_ADDR2LINE_LOCATION="/usr/bin/addr2line""
Environment Details
- Operating System+version: Fedora 34
- Compiler+version: gcc 11.1.1
- Conan version: 1.37.2
- Python version: 3.9.5
- Bazel version: 1.2.1
Steps to reproduce
Can be reproduces using example project and running:
conan install . --build=missing
bazel build //:hello-world
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Cannot define string literals in cc_library · Issue #10859 - GitHub
Description of the problem / feature request: Cannot #define a variable as a string literal.
Read more >string | Bazel
A replacement field can be either a name, a number, or empty. Values are converted to strings using the str function.
Read more >Configurable Build Attributes - Bazel
Configurable attributes, commonly known as select() , is a Bazel feature that lets users toggle the values of build rule attributes at the...
Read more >Configurable Build Attributes - Bazel 0.29.1
By using select() in a configurable attribute, the attribute effectively takes on different values when different conditions hold.
Read more >Commands and Options | Bazel
This option determines whether Bazel will strip debugging information from all binaries and shared libraries, by invoking the linker with the -Wl,--strip-debug ...
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

@fanStefan @tapia sorry I’m very new to conan and thus new to conan + bazel.
Supposedly this issue has been fixed by 1.39.0, which I have confirmed by running
I downloaded the “project” link in the above comment https://github.com/conan-io/conan/issues/9138#issue-927672935, and run
I do see that files including
conandeps/BUILDandconandeps/dependencies.bzlis generated, but the BUILD file is empty, and dependencies.bzl has andef load_conan_dependencies(): pass.Then if I do bazel build, it failed to find the
boostdep.I feel I must have missed some obvious step, but I can figure it out. Can you please kindly provide some pointers on where I should look at to get conan+bazel to work?
Thanks!
Thanks @memsharded , let’s move the discussion to #9354.