bazel-contrib / bazel-contrib/rules_foreign_cc

Should be able to filter copts and linkerflags for make, configure_make etc.

Open
#965 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
Starlark
Stars
737
Forks
270
PR merge metrics
No merged PRs in 30d

Description

Currently it appears that foreign_cc is getting compiler and linker flags from the toolchain. While this may be preferable in some circumstances, it will not always work. For example, a `zlib` build defines `-D_FORTIFY_SOURCE=...`, which means that if you want to us `zlib` in your project, you must define the same fortify-source option, or not define anything -- limiting the use of this feature.

There are many such circumstances like this. For example, we may want `-Werror` for our own code, but turn this option off for foreign dependencies! Real world examples are kinda endless.

At the very least, foreign_cc needs `nocopt` for each of its rule types.

Contributor guide

Open the contributing guide

Research direction

Start by locating the foreign_cc rule entry points for make, configure_make, and the other rule types, then trace how compiler and linker flags come from the toolchain. Review existing flag-related options and determine the scope needed for per-rule nocopt and linker-flag filtering. Done means the supported rule types can exclude unwanted toolchain flags without affecting the project's own compilation flags.

Written by the indexing model from the issue text.

Assessment

Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.