Skip to content

Support for injecting custom toolchain features #517

@limdor

Description

@limdor

Background:
This feature requests comes from the wish of having such feature in toolchains_llvm (see bazel-contrib/toolchains_llvm#591). After taking a look on how this could be implemented and what it would make sense for the overall community, I reached the conclusion that it does not make a lot of sense that a specific toolchain supports that if rules_cc does not support it.
A use case on why this would be needed can be found in the original toolchains_llvm issue but I will put it here again for completness.

Use case:
There are situations where it is helpful to implement a toolchain feature for all toolchains that your project supports.
In our case, this was used for implementing different warning levels/groups that is compiler agnostic.
That allows us to have something like:

cc_library(
    name = "foo",
    srcs = ["foo.cpp"],
    hdrs = ["foo.h"],
    features = [
        "safety_related_warnings",
    ],
)

cc_library(
    name = "bar",
    srcs = ["bar.cpp"],
    hdrs = ["bar.h"],
    features = [
        "security_related_warnings",
    ],
)

Request:
The main question for the maintainers would be, are you interested in that feature? Do you see this as something that we could add to rules_cc? If yes, do you think that it should only supported with the rules-based toolchain approach or also with the old approach? Right now I would say both because afaik the old toolchain approach is not yet replaceable by the rules-based approach in all use cases (i.e. #434).
I have the capacity to work on the topic, I would just ask before I start putting too much time to know the interest and if there is any specific request on direction.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions