bazelbuild / bazel-central-registry

The central registry of Bazel modules for the Bzlmod external dependency system.
https://registry.bazel.build
Apache License 2.0
236 stars 267 forks source link

wanted: nelhage/rules_boost #292

Open chenyuanrun opened 1 year ago

chenyuanrun commented 1 year ago

Can somebody add boost support for bcr? Or may you accept a PR to add boost?

fmeum commented 1 year ago

Contributions in this area would be very welcome. https://github.com/nelhage/rules_boost appears to be a promising candidate for BCR inclusion.

yl7890 commented 1 year ago

+1, but Boost is a very large repository and will likely need many maintainers. Some immediate questions:

zaucy commented 1 year ago

In the past I did fork the individual boost repositories and add BUILD and WORKSPACE files to them. https://github.com/bazelboost. No MODULE files since I did this before bcr was available. What I did was have the individual repositories and a single repository that creates an alias similar to the boostorg repository. Example alias @boost//libs/mp11:mp11 -> @com_github_bazelboost_mp11//:mp11 (source: https://github.com/bazelboost/boost/blob/main/libs/mp11/BUILD.bazel)

However, they are woefully unmaintained. I do use them, but I would consider it more of an experiment.

aaronmondal commented 1 year ago

Looks to me like the rules_boost BUILD.bazel is actively maintained, but I'm not sure whether this covers all libraries: https://github.com/nelhage/rules_boost/blob/master/BUILD.boost. I do agree though that the custom boost_library rules seem rather unnecessary to me. I think it would be a bit nicer to have "raw" rules_cc.

If it helps, I also played around with overlaying boost a while ago. Boost has a CMake build file generator tool. That tool can be rather easily adjusted to output Bazel BUILD files instead. The nice thing is that this way the dependencies for libraries are autogenerated. I believe I had to manually fix some smaller issues with these autogenerated files, but most targets "just worked" out of the box.

A relatively low maintenance overhead way to handle boost in the BCR may be to http_archive-fetch the packaged stable releases from the boost homepage and apply an overlay to it that adds a BUILD.bazel file, similarly to the bazel overlay in the llvm-project. Or we could just add a build file as a BCR-side patch :smile:

hofbi commented 1 month ago

https://github.com/nelhage/rules_boost/pull/553 ported rules_boost to bzlmod. Linking https://github.com/nelhage/rules_boost/issues/573 for cross reference.