bazel-contrib / bazel-contrib/rules_foreign_cc
Misleading examples with `redacted`
- Dominant language
- Starlark
- Stars
- 737
- Forks
- 270
- PR merge metrics
- No merged PRs in 30d
Description
Hi!
I see a couple of examples like examples/third_party/python/BUILD.python3.bazel that have this:
```
configure_options = [
"CFLAGS='-Dredacted=\"redacted\"'",
"--with-openssl=$EXT_BUILD_DEPS/openssl",
"--with-zlib=$EXT_BUILD_DEPS/zlib",
"--enable-optimizations",
```
Adding `CFLAGS` like that is misleading and can cause a lot of headaches, because then the toolchain-provided `CFLAGS` are overwritten. The `configure` command becomes:
`CFLAGS="" ./configure CFLAGS='-Dredacted=\"redacted\"'`
Would it be possible to change the example such that the behavior is preserved while not removing the toolchain-provided flags?
Contributor guide
Research direction
Start with examples/third_party/python/BUILD.python3.bazel and inspect how its configure_options are used to form the configure command. Compare the resulting CFLAGS handling with the toolchain-provided flags; done means the example preserves those flags while retaining the stated behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100