bazel-contrib / bazel-contrib/rules_foreign_cc

Consider adding `toolchains` parameter to `configure_make_variant`

Open
#1,217 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Starlark
Stars
737
Forks
270
PR merge metrics
No merged PRs in 30d

Description

I'm trying to use rules_foreign_cc to build qemu. And at the moment, I'd like to use the preinstalled `pkgconfig` and preinstalled `meson` toolchains.

Unfortunately, it seems like `configure_make_variant` only allows for me to pass in a single toolchain, so I can't do something like:

```
configure_make_variant(
name = "qemu",
lib_source = "@qemu_dist//:all_srcs",
toolchains = ["@rules_foreign_cc//toolchains:preinstalled_meson_toolchain",
"@rules_foreign_cc//toolchains:preinstalled_pkgconfig_toolchain"]
)
```

Alternatively, if there was a way to compose toolchains, the existing `toolchain` parameter might work:

```
configure_make_variant(
name = "qemu",
lib_source = "@qemu_dist//:all_srcs",
toolchain = compose_toolchains(["@rules_foreign_cc//toolchains:preinstalled_meson_toolchain",
"@rules_foreign_cc//toolchains:preinstalled_pkgconfig_toolchain"])
)
```

Contributor guide

Open the contributing guide

Research direction

Start at the implementation and documentation for configure_make_variant and trace how its existing toolchain parameter is handled. Investigate whether multiple toolchains can be accepted or composed, using the preinstalled_meson_toolchain and preinstalled_pkgconfig_toolchain examples as the target case. Done means a configure_make_variant invocation can use both preinstalled toolchains.

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.