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

Add in custom glib patch #1211

Merged
merged 5 commits into from
Jun 24, 2024
Merged

Add in custom glib patch #1211

merged 5 commits into from
Jun 24, 2024

Conversation

andrewkatson
Copy link
Contributor

@jsharpe So I was able to add in glib but not exactly sure where to point it to. I see in MODULE.bazel that we pull in glib_src and glib_dev. And I followed that path to extensions.bzl but I am not quite sure what is going on. Can you give me some hints?

@jsharpe
Copy link
Collaborator

jsharpe commented Jun 11, 2024

AFAIK pkg-config bundles a vendored copy of glib -you'll need to add glib as a dependency to the pkg-config build target in the toolchains directory and then update the configure comand to point at that version of glib?
The existing glib_src and glib_dev I think are just in the examples if I remember correctly so those may be red herrings.

WORKSPACE.bazel Outdated
name = "glib",
urls = ["https://gitlab.gnome.org/GNOME/glib/-/archive/2.80.3/glib-2.80.3.zip"],
strip_prefix = "glib-2.80.3",
patches = ["https://lists.freedesktop.org/archives/pkg-config/attachments/20240503/7e621a18/attachment.bin"],
Copy link
Collaborator

Choose a reason for hiding this comment

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

Its probably a good idea to mirror this into the repo as I assume this file isn't that big and relying on a mail archive might not be the most reliable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay Ive got it mirrored locally and patch is applied. Are there any files I should be excluding so I dont upload them?

@andrewkatson
Copy link
Contributor Author

AFAIK pkg-config bundles a vendored copy of glib -you'll need to add glib as a dependency to the pkg-config build target in the toolchains directory and then update the configure comand to point at that version of glib? The existing glib_src and glib_dev I think are just in the examples if I remember correctly so those may be red herrings.

Somewhere here?

@jsharpe
Copy link
Collaborator

jsharpe commented Jun 14, 2024

See: #1200 (comment) - the patch linked here should be sufficient to fix this - @andrewkatson if you could turn that into a PR against this repo then that'd be great!

@andrewkatson
Copy link
Contributor Author

Okay Ill do that

@andrewkatson
Copy link
Contributor Author

@jsharpe I have a question. You said to mirror glib but whenever I try to mirror it I get prompted for their ssh password and then cannot. I've tried a few different ways of mirroring. Is it sufficient to just copy code from their latest release then apply the patch to that?

@jsharpe
Copy link
Collaborator

jsharpe commented Jun 18, 2024

I actually don't think we need to pull in an updated glib looking at the previous patch I linked from the other issue - seems that pkg-config can be patched to fix this without needing to bring in a newer glib version. - you should be able to take in the patch that was linked, apply to the rules_foreign_cc and then fixup the Label references to not reference the repo that patch comes from and that should be sufficient.

@andrewkatson
Copy link
Contributor Author

Sorry for all the questions I have never even heard of patching before this! @jsharpe I applied one of the patches. The other one talked about .bazelrc which I didnt see in the repo.

@andrewkatson
Copy link
Contributor Author

andrewkatson commented Jun 19, 2024

Also tried to reproduce the errors in the check using the commands from the remote server and it just hangs trying to build the cmake toolchain. I am still trying to debug but if you can tell what the issue is from the buildkite checks then let me know

@andrewkatson
Copy link
Contributor Author

andrewkatson commented Jun 23, 2024

@jsharpe thank you for that merge! Everything passes now! When can we do the final merge?

@barbu110
Copy link

Hey folks, just want to mention this is very important for our project - it's currently blocking builds. Trying to understand if there's a way to get this patch applied from our own project (that is, until this PR gets merged). Any tips?

Copy link
Collaborator

@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.

LGTM - we're not currently checking in the MODULE.bazel.lock file so I've removed that.

@jsharpe jsharpe enabled auto-merge (squash) June 24, 2024 19:37
@andrewkatson
Copy link
Contributor Author

andrewkatson commented Jun 24, 2024

Hey folks, just want to mention this is very important for our project - it's currently blocking builds. Trying to understand if there's a way to get this patch applied from our own project (that is, until this PR gets merged). Any tips?

@barbu110 Use this https://aur.archlinux.org/packages/envoyproxy from #1200 (comment). Does that help?

@jsharpe jsharpe merged commit 0ed9aaa into bazelbuild:main Jun 24, 2024
2 checks passed
@andrewkatson
Copy link
Contributor Author

@jsharpe when do you think you'll publish a new version to the bazel central repo?

fmeum pushed a commit to bazel-contrib/toolchains_llvm that referenced this pull request 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://togithub.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://togithub.com/bazelbuild/rules_foreign_cc/releases/tag/0.11.1)

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

#### New Contributors

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

**Full Changelog**:
bazelbuild/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.

None yet

3 participants