bazel-contrib / bazel-contrib/rules_foreign_cc

pkgconfig builds on macOS don't work with custom toolchains

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

Description

[this line](https://github.com/bazel-contrib/rules_foreign_cc/blob/cb674adc97bdd4a5c5b9a6b5db46689f9be70939/foreign_cc/built_tools/pkgconfig_build.bzl#L62) means that we _always_ use the system `AR` on macOS pkgconfig builds rather that the `AR` from the toolchain. This isn't safe, as there's no guarantee that whatever `AR` is installed on the system can parse object files created by the toolchain's compiler.

Contributor guide

Open the contributing guide

Research direction

Open foreign_cc/built_tools/pkgconfig_build.bzl at line 62 and inspect how the macOS pkgconfig build selects AR. Compare that selection with the AR provided by the toolchain, then verify that a custom toolchain uses its own archiver for the build.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.