Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make pkgconfig Hermetic #1069

Merged
merged 7 commits into from
Apr 21, 2024
Merged

Make pkgconfig Hermetic #1069

merged 7 commits into from
Apr 21, 2024

Conversation

dstufft
Copy link
Contributor

@dstufft dstufft commented Jun 29, 2023

Make sure that when building pkg-config, that we're using the make and other tools from our configured toolchain rather than using whatever we happen to find on $PATH.

Fixes #1065

@dstufft
Copy link
Contributor Author

dstufft commented Jun 29, 2023

Hmm, I don't know enough about macOS to understand why exactly it's failing here

@steeve
Copy link

steeve commented Mar 7, 2024

Hmm, I don't know enough about macOS to understand why exactly it's failing here

For some reason the ARFLAGS are not passed:


CC       libcharset_la-localcharset.lo
--
  | CCLD     libcharset.la
  | error: /Applications/Xcode14.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: no output file specified (specify with -o output)

I can repro it locally.

@dmeijboom
Copy link
Contributor

@dstufft We are currently setting AR to an empty string in the environment variables, that seems to work (not sure why). Would that be a proper fix?

See: 48d7b9f

Copy link
Member

@jsharpe jsharpe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hopefully setting AR to an empty string fixes the macOS build - this just causes it to use ar instead of libtool as configured in the default macOS toolchain.
Otherwise this looks good to me - thanks!

@jsharpe jsharpe enabled auto-merge (squash) April 21, 2024 22:45
@jsharpe jsharpe merged commit 73f7de5 into bazel-contrib:main Apr 21, 2024
2 checks passed
@keith
Copy link
Member

keith commented Jul 2, 2024

would be nice to have a release with this one

@jsharpe
Copy link
Member

jsharpe commented Jul 3, 2024

would be nice to have a release with this one

I'll try and cut a release today..

@jsharpe
Copy link
Member

jsharpe commented Jul 3, 2024

Annoyingly the CI job for the release process failed; I don't currently have time to debug this - the tag is present on the repo so you can reference that release but cutting the release to the BCR will have to be more manual..

@jsharpe
Copy link
Member

jsharpe commented Jul 4, 2024

Actually turned out to be quite straightforward - 0.11.1 should be in the BCR once it's been reviewed there.

fmeum referenced this pull request in bazel-contrib/toolchains_llvm Jul 4, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| rules_foreign_cc | bazel_dep | minor | `0.10.1` -> `0.11.1` |
| [rules_foreign_cc](https://github.com/bazelbuild/rules_foreign_cc) |
http_archive | patch | `0.11.0` -> `0.11.1` |

---

### Release Notes

<details>
<summary>bazelbuild/rules_foreign_cc (rules_foreign_cc)</summary>

###
[`v0.11.1`](https://github.com/bazelbuild/rules_foreign_cc/releases/tag/0.11.1)

[Compare
Source](https://github.com/bazelbuild/rules_foreign_cc/compare/0.11.0...0.11.1)

#### Using Bzlmod with Bazel 6

1.  Enable with `common --enable_bzlmod` in `.bazelrc`.
2.  Add to your `MODULE.bazel` file:

```starlark
bazel_dep(name = "rules_foreign_cc", version = "0.11.1")
```

#### Using WORKSPACE

Paste this snippet into your  file:

```starlark
load("@&#8203;bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "rules_foreign_cc",
    sha256 = "4b33d62cf109bcccf286b30ed7121129cc34cf4f4ed9d8a11f38d9108f40ba74",
    strip_prefix = "rules_foreign_cc-0.11.1",
    url = "https://github.com/bazelbuild/rules_foreign_cc/releases/download/0.11.1/rules_foreign_cc-0.11.1.tar.gz",
)

load("@&#8203;rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies")

### This sets up some common toolchains for building targets. For more details, please see
### https://bazelbuild.github.io/rules_foreign_cc/0.11.1/flatten.html#rules_foreign_cc_dependencies
rules_foreign_cc_dependencies()
```

**Full Changelog**:
bazel-contrib/rules_foreign_cc@0.10.1...0.11.1

#### What's Changed

- Add missing sha256 for meson_src 1.1.1 by
[@&#8203;lalten](https://github.com/lalten) in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1111](https://github.com/bazelbuild/rules_foreign_cc/pull/1111)
- Set an empty tools_data attribute for boost by
[@&#8203;attilaolah](https://github.com/attilaolah) in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1112](https://github.com/bazelbuild/rules_foreign_cc/pull/1112)
- Advertise CcInfo provider by
[@&#8203;calebzulawski](https://github.com/calebzulawski) in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1118](https://github.com/bazelbuild/rules_foreign_cc/pull/1118)
- Allow file targets in native_tool_toolchain() by
[@&#8203;sitaktif](https://github.com/sitaktif) in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1117](https://github.com/bazelbuild/rules_foreign_cc/pull/1117)
- set CC and CXX and their flags in meson by
[@&#8203;xytan0056](https://github.com/xytan0056) in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1098](https://github.com/bazelbuild/rules_foreign_cc/pull/1098)
- Turn off bzlmod in CI for now by
[@&#8203;jsharpe](https://github.com/jsharpe) in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1142](https://github.com/bazelbuild/rules_foreign_cc/pull/1142)
- Fix `//openssl/...` by calling `openssl_setup()` by
[@&#8203;bcsgh](https://github.com/bcsgh) in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1137](https://github.com/bazelbuild/rules_foreign_cc/pull/1137)
- Sort tests under examples/third_party and add zlib to the list. by
[@&#8203;bcsgh](https://github.com/bcsgh) in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1136](https://github.com/bazelbuild/rules_foreign_cc/pull/1136)
- Use gazelle to generate bzl_library targets by
[@&#8203;jsharpe](https://github.com/jsharpe) in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1127](https://github.com/bazelbuild/rules_foreign_cc/pull/1127)
- Use platform specific configs in bazelrc to reduce scope of settings
by [@&#8203;jsharpe](https://github.com/jsharpe) in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1144](https://github.com/bazelbuild/rules_foreign_cc/pull/1144)
- Update to ubuntu 20.04 on RBE by
[@&#8203;jsharpe](https://github.com/jsharpe) in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1145](https://github.com/bazelbuild/rules_foreign_cc/pull/1145)
- Remove explicit mention of bazel 4.x support by
[@&#8203;jsharpe](https://github.com/jsharpe) in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1146](https://github.com/bazelbuild/rules_foreign_cc/pull/1146)
- Add mirrors to external repositories by
[@&#8203;mishazharov](https://github.com/mishazharov) in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1153](https://github.com/bazelbuild/rules_foreign_cc/pull/1153)
- Build msvc cmake with prebuilt cmake by
[@&#8203;matt-sm](https://github.com/matt-sm) in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1148](https://github.com/bazelbuild/rules_foreign_cc/pull/1148)
- Simplify the toolchain registration for bzlmod by
[@&#8203;jsharpe](https://github.com/jsharpe) in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1105](https://github.com/bazelbuild/rules_foreign_cc/pull/1105)
- Update CMake versions by
[@&#8203;jsharpe](https://github.com/jsharpe) in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1159](https://github.com/bazelbuild/rules_foreign_cc/pull/1159)
- Fix tool path for nmake by
[@&#8203;jsun-splunk](https://github.com/jsun-splunk) in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1165](https://github.com/bazelbuild/rules_foreign_cc/pull/1165)
- chore(deps): Bump rules_apple. Fixes
[#&#8203;1156](https://github.com/bazelbuild/rules_foreign_cc/issues/1156)
by [@&#8203;jsharpe](https://github.com/jsharpe) in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1166](https://github.com/bazelbuild/rules_foreign_cc/pull/1166)
- Add make 4.4.1 by [@&#8203;novas0x2a](https://github.com/novas0x2a)
in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1167](https://github.com/bazelbuild/rules_foreign_cc/pull/1167)
- Increase resiliency of `runnable_binary` by
[@&#8203;mishazharov](https://github.com/mishazharov) in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1134](https://github.com/bazelbuild/rules_foreign_cc/pull/1134)
- Fix windows examples CI by upgrading TLS trust store by
[@&#8203;mishazharov](https://github.com/mishazharov) in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1171](https://github.com/bazelbuild/rules_foreign_cc/pull/1171)
- Fixes the CI failure at Bazel@HEAD by
[@&#8203;sgowroji](https://github.com/sgowroji) in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1173](https://github.com/bazelbuild/rules_foreign_cc/pull/1173)
- Add j2objc fragment to rules by
[@&#8203;sgowroji](https://github.com/sgowroji) in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1175](https://github.com/bazelbuild/rules_foreign_cc/pull/1175)
- Cater for different drive letters when normalizing path by
[@&#8203;matt-sm](https://github.com/matt-sm) in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1169](https://github.com/bazelbuild/rules_foreign_cc/pull/1169)
- Fix
[#&#8203;1161](https://github.com/bazelbuild/rules_foreign_cc/issues/1161):
set the `CMAKE` environment variables for prebuilt toolchains. by
[@&#8203;thb-sb](https://github.com/thb-sb) in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1163](https://github.com/bazelbuild/rules_foreign_cc/pull/1163)
- Add aarch64 to prebuild library constraints for macos by
[@&#8203;dmeijboom](https://github.com/dmeijboom) in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1176](https://github.com/bazelbuild/rules_foreign_cc/pull/1176)
- Use a sed delimiter that is unlikely to appear in the input by
[@&#8203;mkauf](https://github.com/mkauf) in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1184](https://github.com/bazelbuild/rules_foreign_cc/pull/1184)
- Update rules_apple by
[@&#8203;sgowroji](https://github.com/sgowroji) in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1190](https://github.com/bazelbuild/rules_foreign_cc/pull/1190)
- Fix - Copy Dir ignores hidden files on macOS by
[@&#8203;LaurenceTews](https://github.com/LaurenceTews) in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1188](https://github.com/bazelbuild/rules_foreign_cc/pull/1188)
- fix(docs): Port docs generation to bzlmod to fix user facing doc
generation by [@&#8203;jsharpe](https://github.com/jsharpe) in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1193](https://github.com/bazelbuild/rules_foreign_cc/pull/1193)
- Revert "fix(docs): Port docs generation to bzlmod to fix user facing
doc generation" by [@&#8203;jsharpe](https://github.com/jsharpe) in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1194](https://github.com/bazelbuild/rules_foreign_cc/pull/1194)
- chore(deps): Add ninja 1.12.0 and latest versions of cmake by
[@&#8203;jsharpe](https://github.com/jsharpe) in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1192](https://github.com/bazelbuild/rules_foreign_cc/pull/1192)
- adjust relative msvc paths by
[@&#8203;matt-sm](https://github.com/matt-sm) in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1180](https://github.com/bazelbuild/rules_foreign_cc/pull/1180)
- Make pkgconfig Hermetic by
[@&#8203;dstufft](https://github.com/dstufft) in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1069](https://github.com/bazelbuild/rules_foreign_cc/pull/1069)
- Exclude filenames with spaces from cmake toolchains by
[@&#8203;illicitonion](https://github.com/illicitonion) in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1199](https://github.com/bazelbuild/rules_foreign_cc/pull/1199)
- fix: change cygpath to mixed mode by
[@&#8203;jsun-splunk](https://github.com/jsun-splunk) in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1204](https://github.com/bazelbuild/rules_foreign_cc/pull/1204)
- fix: path expansion on windows by
[@&#8203;jsun-splunk](https://github.com/jsun-splunk) in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1207](https://github.com/bazelbuild/rules_foreign_cc/pull/1207)
- Revert inadvertent direct commit to main by
[@&#8203;jsharpe](https://github.com/jsharpe) in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1213](https://github.com/bazelbuild/rules_foreign_cc/pull/1213)
- Update framework.bzl to account for externalIncludes by
[@&#8203;layus](https://github.com/layus) in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1215](https://github.com/bazelbuild/rules_foreign_cc/pull/1215)
- chore(deps): cmake/ninja: add new versions by
[@&#8203;novas0x2a](https://github.com/novas0x2a) in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1212](https://github.com/bazelbuild/rules_foreign_cc/pull/1212)
- Revert "cmake: use variable expansion on generator args" by
[@&#8203;jsharpe](https://github.com/jsharpe) in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1219](https://github.com/bazelbuild/rules_foreign_cc/pull/1219)
- Add in custom glib patch by
[@&#8203;andrewkatson](https://github.com/andrewkatson) in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1211](https://github.com/bazelbuild/rules_foreign_cc/pull/1211)

#### New Contributors

- [@&#8203;lalten](https://github.com/lalten) made their first
contribution in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1111](https://github.com/bazelbuild/rules_foreign_cc/pull/1111)
- [@&#8203;sitaktif](https://github.com/sitaktif) made their first
contribution in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1117](https://github.com/bazelbuild/rules_foreign_cc/pull/1117)
- [@&#8203;mishazharov](https://github.com/mishazharov) made their
first contribution in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1153](https://github.com/bazelbuild/rules_foreign_cc/pull/1153)
- [@&#8203;matt-sm](https://github.com/matt-sm) made their first
contribution in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1148](https://github.com/bazelbuild/rules_foreign_cc/pull/1148)
- [@&#8203;jsun-splunk](https://github.com/jsun-splunk) made their
first contribution in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1165](https://github.com/bazelbuild/rules_foreign_cc/pull/1165)
- [@&#8203;sgowroji](https://github.com/sgowroji) made their first
contribution in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1173](https://github.com/bazelbuild/rules_foreign_cc/pull/1173)
- [@&#8203;thb-sb](https://github.com/thb-sb) made their first
contribution in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1163](https://github.com/bazelbuild/rules_foreign_cc/pull/1163)
- [@&#8203;dmeijboom](https://github.com/dmeijboom) made their first
contribution in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1176](https://github.com/bazelbuild/rules_foreign_cc/pull/1176)
- [@&#8203;mkauf](https://github.com/mkauf) made their first
contribution in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1184](https://github.com/bazelbuild/rules_foreign_cc/pull/1184)
- [@&#8203;LaurenceTews](https://github.com/LaurenceTews) made their
first contribution in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1188](https://github.com/bazelbuild/rules_foreign_cc/pull/1188)
- [@&#8203;layus](https://github.com/layus) made their first
contribution in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1215](https://github.com/bazelbuild/rules_foreign_cc/pull/1215)
- [@&#8203;andrewkatson](https://github.com/andrewkatson) made their
first contribution in
[https://github.com/bazelbuild/rules_foreign_cc/pull/1211](https://github.com/bazelbuild/rules_foreign_cc/pull/1211)

**Full Changelog**:
bazel-contrib/rules_foreign_cc@0.10.1...0.11.1

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/bazel-contrib/toolchains_llvm).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjEuOSIsInVwZGF0ZWRJblZlciI6IjM3LjQyMS45IiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbXX0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pkgconfig_tool_unix not hermetic
5 participants