-
Notifications
You must be signed in to change notification settings - Fork 231
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
bzlmod compatibility #522
Closed
Closed
bzlmod compatibility #522
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
a5a8d76
Testing attempt at bzlmod support. Working, but has flaws that need a…
Attempt3035 0fef40c
Resolved COPTS path resolution issue. Broke includes into separate de…
Attempt3035 cfda40e
Fixed public api header visibility issue
Attempt3035 9389ca0
Added alias support for all boost functions
Attempt3035 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module(name = "boost", repo_name = "com_github_nelhage_rules_boost") | ||
|
||
bazel_dep( | ||
name = "platforms", | ||
version = "0.0.7", | ||
) | ||
|
||
boost_libs = use_extension("//:boost/boost.bzl", "boost_deps_extension") | ||
|
||
use_repo(boost_libs, "boost") | ||
use_repo(boost_libs, "bazel_skylib") | ||
use_repo(boost_libs, "zlib") | ||
use_repo(boost_libs, "org_bzip_bzip2") | ||
use_repo(boost_libs, "org_lzma_lzma") | ||
use_repo(boost_libs, "com_github_facebook_zstd") | ||
use_repo(boost_libs, "openssl") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
bazel_skylib, zlib, bzip2, zstd, openssl are all availble in the official registry. How about using those versions? (Didn't look yet into the details how they are built TBH.)
@Attempt3035 Any plans finishing this PR?
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.
Hey @mvukov!
This PR does work as it stands, however:
I've been doing a bunch of work over the last couple of months trying to get the entirety of boost into bzlmod. It's still a bit of a mess and work in progress, but made a PR so you can check it out here: bazelbuild/bazel-central-registry#1280
Hopefully that will be the way forward! Will try and get it tidied up and some readme instructions so you can give it a go, most of the modules are working, just adding tests!
Ideally, we'd all be working on the boost stuff in the same place. Any thoughts on the transition to bzlmod for this entire repository? Would we expect users to just switch when they turn their projects to bzlmod instead of workspace, or would it be valuable to have a module adaptor that adds aliases to the project and requires all boost libraries, so that effectively, users here could just add that bzlmod module to their project and all the targets would still work? Food for thought anyway...
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.
Took a look at bazelbuild/bazel-central-registry#1280. How do you maintain all those patches? (I really hope not by hand). Unless I am mistaken, for each boost module a separate archive is downloaded. What is the benefit compared to a single archive downloaded here?
Didn't dive into all the details, but this PR here and approach of this repo seem much more maintainable than bazelbuild/bazel-central-registry#1280 TBH. If you go bazelbuild/bazel-central-registry#1280 route, does that mean this repo becomes deprecated?
Any objection to finishing up this PR? seems almost ready.
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.
@mvukov Off course, you need some scripts to generate all this stuff - we could place those scripts in this repo here. I also started for other libs to have some helper scripts to be able to switch to newer versions without all the boilerplate. Some people only want to use a single header library of boost - why would you then download 300 MB complete boost? I see many people only using boost.asio. Also in the long term, we could try to bring Bazel support directly to the boost repo itself. Then we could easily copy & paste our BUILD and MODULE since boost itself is organized in this "multirepo" approach. Smaller modules == less CI build traffic, less disk usage, etc. - there are some benefits