-
Notifications
You must be signed in to change notification settings - Fork 440
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
Bazelmod documentation and code examples. #2713
Conversation
Signed-off-by: Marvin Hansen <[email protected]>
Signed-off-by: Marvin Hansen <[email protected]>
Signed-off-by: Marvin Hansen <[email protected]>
Signed-off-by: Marvin Hansen <[email protected]>
Updated the crate_universe_bzlmod.md documentation. This PR updates both, the example folder and the doc folder. Although in the doc folder, it only Note, the documentation references some of the code examples in this PR, specifically the dependency vendoring example. Please review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't finished going through all the examples but could you update the presubmit yaml to make sure the examples are built and regression tested?
So far this is looking amazing though!
@UebelAndre I'm looking at the presubmit.yaml and how the other examples are build. I've to look closer into regression testing because I don't think I've added much yet. Also, I need a bit of time to figure this out because I've stopped using GH actions a long time ago. The good news is, the same config used in the examples builds on my CI (BuildBuddy on Ubuntu 20.04) and the way I understand this pre-sub config is that the bzlmd job also runs on ubuntu 20.04 so I hope this is just a matter of time. |
Signed-off-by: Marvin Hansen <[email protected]>
Signed-off-by: Marvin Hansen <[email protected]>
Signed-off-by: Marvin Hansen <[email protected]>
Signed-off-by: Marvin Hansen <[email protected]>
Signed-off-by: Marvin Hansen <[email protected]>
Signed-off-by: Marvin Hansen <[email protected]>
Signed-off-by: Marvin Hansen <[email protected]>
Looks like this was a lot easier than I though.
The only remaining CI issue seems to be related to a git detached file that prevents the doc build. I have no idea how that happened, but would you please take a look how to fix the doc build? Doc build: https://buildkite.com/bazel/rules-rust-rustlang/builds/11570#019058a0-1986-4b05-bafc-6ed8ce8443c7 |
Signed-off-by: Marvin Hansen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay! I had one last question and seems like the docs job is out of date? Maybe you just need to run https://github.com/bazelbuild/rules_rust/blob/0.46.0/docs/update_docs.sh
Updated all dependencies. Updated Readme. Added sysroot for Intel/AMD to ensure the example works on Apple Silicon / Arm systems, Moved sysroot into MODULE.bazel. Added cross compile build and test to CI. Signed-off-by: Marvin Hansen <[email protected]>
Removed WORKSPACE file. Updated Readme. Signed-off-by: Marvin Hansen <[email protected]>
Signed-off-by: Marvin Hansen <[email protected]>
Signed-off-by: Marvin Hansen <[email protected]>
Signed-off-by: Marvin Hansen <[email protected]>
Signed-off-by: Marvin Hansen <[email protected]>
For all practical purpose, it's best to exclude the MUSL example from this PR, merge it, and then then move on. I can re-add the example anytime after the toolchain issue has been resolved. I've tried quite a few things to resolve the MUSL issue, but to no avail. The way I see it is, that the toolchain resolution touches quite a few sensitive code blocks and somehow it's not so easy |
Signed-off-by: Marvin Hansen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is generally looking great, thanks so much for taking the time to put it all together!
I agree we should probably remove the musl example until we resolve #2726 but would love to re-add it after then!
Good. Co-authored-by: Daniel Wagner-Hall <[email protected]>
Co-authored-by: Daniel Wagner-Hall <[email protected]>
Signed-off-by: Marvin Hansen <[email protected]>
Signed-off-by: Marvin Hansen <[email protected]>
Signed-off-by: Marvin Hansen <[email protected]>
Signed-off-by: Marvin Hansen <[email protected]>
Signed-off-by: Marvin Hansen <[email protected]>
Please let me know if you want any further changes. Otherwise, build is green. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Green. Good to go?
@UebelAndre Would you please take a final look and decide whether to merge? That would make the Bazelmod docs available online and allow to close a number of related issues. Thank you |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much!
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | rules_rust | bazel_dep | minor | `0.47.1` -> `0.48.0` | | [rules_rust](https://github.com/bazelbuild/rules_rust) | http_archive | minor | `0.47.1` -> `0.48.0` | --- ### Release Notes <details> <summary>bazelbuild/rules_rust (rules_rust)</summary> ### [`v0.48.0`](https://github.com/bazelbuild/rules_rust/releases/tag/0.48.0) [Compare Source](https://github.com/bazelbuild/rules_rust/compare/0.47.1...0.48.0) ### 0.48.0 #### Bzlmod ```python bazel_dep(name = "rules_rust", version = "0.48.0") ``` #### WORKSPACE ```python load("@​bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "rules_rust", integrity = "sha256-Weev1uz2QztBlDA88JX6A1N72SucD1V8lBsaliM0TTg=", urls = ["https://github.com/bazelbuild/rules_rust/releases/download/0.48.0/rules_rust-v0.48.0.tar.gz"], ) ``` Additional documentation can be found at: https://bazelbuild.github.io/rules_rust/#setup #### What's Changed - Add support for shared test-only modules by [@​IvanIsCoding](https://github.com/IvanIsCoding) in [https://github.com/bazelbuild/rules_rust/pull/2734](https://github.com/bazelbuild/rules_rust/pull/2734) - Bazelmod documentation and code examples. by [@​marvin-hansen](https://github.com/marvin-hansen) in [https://github.com/bazelbuild/rules_rust/pull/2713](https://github.com/bazelbuild/rules_rust/pull/2713) - Add support for --wrap-extern-fns to bindgen rules by [@​hlopko](https://github.com/hlopko) in [https://github.com/bazelbuild/rules_rust/pull/2743](https://github.com/bazelbuild/rules_rust/pull/2743) - Pass toolchain param in ctx.action.run in bindgen by [@​hlopko](https://github.com/hlopko) in [https://github.com/bazelbuild/rules_rust/pull/2745](https://github.com/bazelbuild/rules_rust/pull/2745) - Make it possible to not specify clang binary in bindgen by [@​hlopko](https://github.com/hlopko) in [https://github.com/bazelbuild/rules_rust/pull/2746](https://github.com/bazelbuild/rules_rust/pull/2746) - Make rustfmt toolchain optional in bindgen by [@​hlopko](https://github.com/hlopko) in [https://github.com/bazelbuild/rules_rust/pull/2744](https://github.com/bazelbuild/rules_rust/pull/2744) - Fix collecting cc deps in collect_deps by [@​mvukov](https://github.com/mvukov) in [https://github.com/bazelbuild/rules_rust/pull/2699](https://github.com/bazelbuild/rules_rust/pull/2699) - Support incompatible enable proto toolchain resolution by [@​illicitonion](https://github.com/illicitonion) in [https://github.com/bazelbuild/rules_rust/pull/2741](https://github.com/bazelbuild/rules_rust/pull/2741) - Release 0.48.0 by [@​illicitonion](https://github.com/illicitonion) in [https://github.com/bazelbuild/rules_rust/pull/2750](https://github.com/bazelbuild/rules_rust/pull/2750) #### New Contributors - [@​IvanIsCoding](https://github.com/IvanIsCoding) made their first contribution in [https://github.com/bazelbuild/rules_rust/pull/2734](https://github.com/bazelbuild/rules_rust/pull/2734) - [@​marvin-hansen](https://github.com/marvin-hansen) made their first contribution in [https://github.com/bazelbuild/rules_rust/pull/2713](https://github.com/bazelbuild/rules_rust/pull/2713) - [@​mvukov](https://github.com/mvukov) made their first contribution in [https://github.com/bazelbuild/rules_rust/pull/2699](https://github.com/bazelbuild/rules_rust/pull/2699) **Full Changelog**: bazelbuild/rules_rust@0.47.1...0.48.0 </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:eyJjcmVhdGVkSW5WZXIiOiIzNy40MzEuNCIsInVwZGF0ZWRJblZlciI6IjM3LjQzMS40IiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbXX0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Somehow in PR #2713, the bazelmod docs that I wrote went missing. This PR restores the bazelmod docs. Should be easy to review. --------- Signed-off-by: Marvin Hansen <[email protected]>
This PR provides documentation of Bazelmod and several code examples that addresses a number of issues related to Bazelmod.
Preview of the documentation: https://github.com/marvin-hansen/rules_rust/blob/main/docs/crate_universe_bzlmod.md
First and foremost it paves the way for a meaningful update the Bazelmod documentation that references these and existing code examples. This touches at least the following issues:
The compile_opt example addresses or resolves:
The musl_cross_compilling example addresses or resolves
The oci_container does not relate to any open issue,
although the tokio example in it gives a nice end to end example so
this definitely helps those looking for something non-trivial.
The proto example addresses or resolves:
Formalities