Repository: bazelbuild/bazel-central-registry
Pull request #3977: Added Boost 1.87.0 `foreach`, `sort`,  and `url`.
Author: login: vtsao-openai
Labels: name: presubmit-auto-run
description: Presubmit jobs will be triggered for new changes automatically without reviewer's approval
name: skip-url-stability-check
description: Skip the URL stability check for the PR
name: auto-merged
description: This PR is automatically merged by the BCR reviewer bot.
Created: 2025-03-11T02:08:45Z | Merged: 2025-03-12T07:39:55Z

Much of Boost in the BCR was upgraded to 1.87.0 recently, so I'm adding some of the remaining Boost libraries that don't have 1.87.0 yet.


Diff:
diff --git a/modules/boost.foreach/1.87.0/MODULE.bazel b/modules/boost.foreach/1.87.0/MODULE.bazel
new file mode 100644
index 00000000000..f8e3e551695
--- /dev/null
+++ b/modules/boost.foreach/1.87.0/MODULE.bazel
@@ -0,0 +1,14 @@
+module(
+    name = "boost.foreach",
+    version = "1.87.0",
+    bazel_compatibility = [">=7.2.1"],  # need support for "overlay" directory
+    compatibility_level = 108700,
+)
+
+bazel_dep(name = "boost.config", version = "1.87.0")
+bazel_dep(name = "boost.core", version = "1.87.0")
+bazel_dep(name = "boost.iterator", version = "1.87.0")
+bazel_dep(name = "boost.mpl", version = "1.87.0")
+bazel_dep(name = "boost.range", version = "1.87.0")
+bazel_dep(name = "boost.type_traits", version = "1.87.0")
+bazel_dep(name = "rules_cc", version = "0.1.1")
diff --git a/modules/boost.foreach/1.87.0/overlay/BUILD.bazel b/modules/boost.foreach/1.87.0/overlay/BUILD.bazel
new file mode 100644
index 00000000000..4e8f7aebc2a
--- /dev/null
+++ b/modules/boost.foreach/1.87.0/overlay/BUILD.bazel
@@ -0,0 +1,28 @@
+load("@rules_cc//cc:defs.bzl", "cc_library")
+load("//:gen_test_targets.bzl", "gen_test_targets")
+
+cc_library(
+    name = "boost.foreach",
+    hdrs = glob([
+        "include/**/*.hpp",
+    ]),
+    features = [
+        "parse_headers",
+    ],
+    includes = ["include"],
+    visibility = ["//visibility:public"],
+    deps = [
+        "@boost.config",
+        "@boost.core",
+        "@boost.iterator",
+        "@boost.mpl",
+        "@boost.range",
+        "@boost.type_traits",
+    ],
+)
+
+gen_test_targets(
+    name = "gen_boost.foreach_test_targets",
+    cc_srcs = glob(["test/*.cpp"]),
+    header_srcs = glob(["test/*.hpp"]),
+)
diff --git a/modules/boost.foreach/1.87.0/overlay/MODULE.bazel b/modules/boost.foreach/1.87.0/overlay/MODULE.bazel
new file mode 120000
index 00000000000..9b599e3ad9c
--- /dev/null
+++ b/modules/boost.foreach/1.87.0/overlay/MODULE.bazel
@@ -0,0 +1 @@
+../MODULE.bazel
\ No newline at end of file
diff --git a/modules/boost.foreach/1.87.0/overlay/gen_test_targets.bzl b/modules/boost.foreach/1.87.0/overlay/gen_test_targets.bzl
new file mode 100644
index 00000000000..4a97b5fd61f
--- /dev/null
+++ b/modules/boost.foreach/1.87.0/overlay/gen_test_targets.bzl
@@ -0,0 +1,19 @@
+def gen_test_targets(name, cc_srcs, header_srcs):
+    """Generates a cc_test target for each source file.
+
+    Each of boost.foreach's tests have their own main function, so each test
+    needs to be a separate cc_test target.
+
+    Args:
+      name: name of this macro (unused)
+      cc_srcs: test files to generate cc_test targets for
+      header_srcs: header files
+    """
+
+    for src in cc_srcs:
+        name = src.removeprefix("test/").removesuffix(".cpp").replace("/", "_") + "_test"
+        native.cc_test(
+            name = name,
+            srcs = [src] + header_srcs,
+            deps = [":boost.foreach"],
+        )
diff --git a/modules/boost.foreach/1.87.0/presubmit.yml b/modules/boost.foreach/1.87.0/presubmit.yml
new file mode 100644
index 00000000000..d302b7f7163
--- /dev/null
+++ b/modules/boost.foreach/1.87.0/presubmit.yml
@@ -0,0 +1,22 @@
+matrix:
+  platform:
+    - debian11
+    - ubuntu2004
+    - ubuntu2204
+    - ubuntu2404
+    - macos
+    - macos_arm64
+    - windows
+  bazel: [7.x, 8.x, rolling]
+tasks:
+  verify_targets:
+    platform: ${{ platform }}
+    bazel: ${{ bazel }}
+    build_flags:
+      - "--process_headers_in_dependencies"
+    build_targets:
+      - "@boost.foreach//:boost.foreach"
+    test_flags:
+      - "--process_headers_in_dependencies"
+    test_targets:
+      - "@boost.foreach//:all"
diff --git a/modules/boost.foreach/1.87.0/source.json b/modules/boost.foreach/1.87.0/source.json
new file mode 100644
index 00000000000..733903d89aa
--- /dev/null
+++ b/modules/boost.foreach/1.87.0/source.json
@@ -0,0 +1,10 @@
+{
+    "url": "https://github.com/boostorg/foreach/archive/refs/tags/boost-1.87.0.tar.gz",
+    "integrity": "sha256-sKEAx0Im5szKIqkxP2lT7T7wKBzRmxUELidccQjTyiA=",
+    "strip_prefix": "foreach-boost-1.87.0",
+    "overlay": {
+        "BUILD.bazel": "sha256-/oTmGKXLFPKQs/6QTQd7+Tjitfo0PMyvwLrB9DRQvsc=",
+        "MODULE.bazel": "sha256-Y7buY5Zjs9P2NLQHbxLux2FURztcrQP4RIFJciIf218=",
+        "gen_test_targets.bzl": "sha256-6VolYhZW3aUi/NIA8MOB8owzcllvTJM4mdblh8ZPGiQ="
+    }
+}
diff --git a/modules/boost.foreach/metadata.json b/modules/boost.foreach/metadata.json
index 3b2118ae298..e6c80ef2733 100644
--- a/modules/boost.foreach/metadata.json
+++ b/modules/boost.foreach/metadata.json
@@ -18,7 +18,8 @@
     "versions": [
         "1.83.0",
         "1.83.0.bcr.1",
-        "1.83.0.bcr.2"
+        "1.83.0.bcr.2",
+        "1.87.0"
     ],
     "yanked_versions": {}
 }
diff --git a/modules/boost.sort/1.87.0/MODULE.bazel b/modules/boost.sort/1.87.0/MODULE.bazel
new file mode 100644
index 00000000000..4b5df006b9d
--- /dev/null
+++ b/modules/boost.sort/1.87.0/MODULE.bazel
@@ -0,0 +1,17 @@
+module(
+    name = "boost.sort",
+    version = "1.87.0",
+    bazel_compatibility = [">=7.2.1"],  # need support for "overlay" directory
+    compatibility_level = 108700,
+)
+
+bazel_dep(name = "boost.config", version = "1.87.0")
+bazel_dep(name = "boost.core", version = "1.87.0")
+bazel_dep(name = "boost.range", version = "1.87.0")
+bazel_dep(name = "boost.static_assert", version = "1.87.0")
+bazel_dep(name = "boost.type_traits", version = "1.87.0")
+bazel_dep(name = "rules_cc", version = "0.1.1")
+
+# For tests
+bazel_dep(name = "boost.test", version = "1.87.0")
+bazel_dep(name = "platforms", version = "0.0.11")
diff --git a/modules/boost.sort/1.87.0/overlay/BUILD.bazel b/modules/boost.sort/1.87.0/overlay/BUILD.bazel
new file mode 100644
index 00000000000..d9a8644d723
--- /dev/null
+++ b/modules/boost.sort/1.87.0/overlay/BUILD.bazel
@@ -0,0 +1,40 @@
+load("@rules_cc//cc:defs.bzl", "cc_library")
+load("//:gen_test_targets.bzl", "gen_test_targets")
+
+cc_library(
+    name = "boost.sort",
+    hdrs = glob(
+        ["include/**/*.hpp"],
+        exclude = ["include/boost/sort/common/pivot.hpp"],
+    ),
+    features = ["parse_headers"],
+    includes = ["include"],
+    textual_hdrs = ["include/boost/sort/common/pivot.hpp"],
+    visibility = ["//visibility:public"],
+    deps = [
+        "@boost.config",
+        "@boost.core",
+        "@boost.range",
+        "@boost.static_assert",
+        "@boost.type_traits",
+    ],
+)
+
+gen_test_targets(
+    name = "gen_boost.sort_test_targets",
+    cc_srcs = glob(
+        ["test/*.cpp"],
+        # These tests pass (Boost reports no errors) but fail with a
+        # "free(): invalid pointer" error on Ubuntu 24.04 on BCR's CI, but I
+        # cannot reproduce this locally, so just exclude for now.
+        exclude = [
+            "test/float_sort_test.cpp",
+            "test/test_block_indirect_sort.cpp",
+            "test/test_insert_sort.cpp",
+            "test/integer_sort_test.cpp",
+            "test/sort_detail_test.cpp",
+            "test/test_spinsort.cpp",
+            "test/string_sort_test.cpp",
+        ],
+    ),
+)
diff --git a/modules/boost.sort/1.87.0/overlay/MODULE.bazel b/modules/boost.sort/1.87.0/overlay/MODULE.bazel
new file mode 120000
index 00000000000..9b599e3ad9c
--- /dev/null
+++ b/modules/boost.sort/1.87.0/overlay/MODULE.bazel
@@ -0,0 +1 @@
+../MODULE.bazel
\ No newline at end of file
diff --git a/modules/boost.sort/1.87.0/overlay/gen_test_targets.bzl b/modules/boost.sort/1.87.0/overlay/gen_test_targets.bzl
new file mode 100644
index 00000000000..72711739c32
--- /dev/null
+++ b/modules/boost.sort/1.87.0/overlay/gen_test_targets.bzl
@@ -0,0 +1,25 @@
+def gen_test_targets(name, cc_srcs):
+    """Generates a cc_test target for each source file.
+
+    Each of boost.sort's tests have their own main function, so each test needs
+    to be a separate cc_test target.
+
+    Args:
+      name: name of this macro (unused)
+      cc_srcs: test files to generate cc_test targets for
+    """
+
+    for src in cc_srcs:
+        name = src.removeprefix("test/").removeprefix("test_").removesuffix(".cpp").removesuffix("_test").replace("/", "_") + "_test"
+        native.cc_test(
+            name = name,
+            srcs = [src],
+            deps = [
+                ":boost.sort",
+                "@boost.test",
+            ],
+            linkopts = select({
+                "@platforms//os:linux": ["-lpthread"],
+                "//conditions:default": [],
+            }),
+        )
diff --git a/modules/boost.sort/1.87.0/presubmit.yml b/modules/boost.sort/1.87.0/presubmit.yml
new file mode 100644
index 00000000000..b6e087d3cb7
--- /dev/null
+++ b/modules/boost.sort/1.87.0/presubmit.yml
@@ -0,0 +1,22 @@
+matrix:
+  platform:
+    - debian11
+    - ubuntu2004
+    - ubuntu2204
+    - ubuntu2404
+    - macos
+    - macos_arm64
+    - windows
+  bazel: [7.x, 8.x, rolling]
+tasks:
+  verify_targets:
+    platform: ${{ platform }}
+    bazel: ${{ bazel }}
+    build_flags:
+      - "--process_headers_in_dependencies"
+    build_targets:
+      - "@boost.sort//:boost.sort"
+    test_flags:
+      - "--process_headers_in_dependencies"
+    test_targets:
+      - "@boost.sort//:all"
diff --git a/modules/boost.sort/1.87.0/source.json b/modules/boost.sort/1.87.0/source.json
new file mode 100644
index 00000000000..06739309771
--- /dev/null
+++ b/modules/boost.sort/1.87.0/source.json
@@ -0,0 +1,10 @@
+{
+    "url": "https://github.com/boostorg/sort/archive/refs/tags/boost-1.87.0.tar.gz",
+    "integrity": "sha256-0n7hZ0qVc7iDRBJADGw5dwRGWNsAejnhM0JHGemYv/U=",
+    "strip_prefix": "sort-boost-1.87.0",
+    "overlay": {
+        "BUILD.bazel": "sha256-XyPyMXBAl/Wuq2AE3dmzLgE7bLeoP1mxEhyDL1x0g5Y=",
+        "MODULE.bazel": "sha256-l2iQ9Od0tnnUA8+9rd6xR0eKmYSJ2cviPCyK8aWcvvQ=",
+        "gen_test_targets.bzl": "sha256-o469Z9Daef21IW9teHkR2UmEgqLo9UY8PZ/575wSUp4="
+    }
+}
diff --git a/modules/boost.sort/metadata.json b/modules/boost.sort/metadata.json
index 1447cc084c6..a61f540a49f 100644
--- a/modules/boost.sort/metadata.json
+++ b/modules/boost.sort/metadata.json
@@ -18,7 +18,8 @@
     "versions": [
         "1.83.0",
         "1.83.0.bcr.1",
-        "1.83.0.bcr.2"
+        "1.83.0.bcr.2",
+        "1.87.0"
     ],
     "yanked_versions": {}
 }
diff --git a/modules/boost.url/1.87.0/MODULE.bazel b/modules/boost.url/1.87.0/MODULE.bazel
new file mode 100644
index 00000000000..f5362ebb22f
--- /dev/null
+++ b/modules/boost.url/1.87.0/MODULE.bazel
@@ -0,0 +1,24 @@
+module(
+    name = "boost.url",
+    version = "1.87.0",
+    bazel_compatibility = [">=7.2.1"],  # need support for "overlay" directory
+    compatibility_level = 108700,
+)
+
+bazel_dep(name = "boost.align", version = "1.87.0")
+bazel_dep(name = "boost.assert", version = "1.87.0")
+bazel_dep(name = "boost.config", version = "1.87.0")
+bazel_dep(name = "boost.core", version = "1.87.0")
+bazel_dep(name = "boost.mp11", version = "1.87.0")
+bazel_dep(name = "boost.optional", version = "1.87.0")
+bazel_dep(name = "boost.static_assert", version = "1.87.0")
+bazel_dep(name = "boost.system", version = "1.87.0")
+bazel_dep(name = "boost.throw_exception", version = "1.87.0")
+bazel_dep(name = "boost.type_traits", version = "1.87.0")
+bazel_dep(name = "boost.variant2", version = "1.87.0")
+bazel_dep(name = "platforms", version = "0.0.11")
+bazel_dep(name = "rules_cc", version = "0.1.1")
+
+# For tests
+bazel_dep(name = "boost.container", version = "1.87.0")
+bazel_dep(name = "boost.filesystem", version = "1.87.0")
diff --git a/modules/boost.url/1.87.0/overlay/BUILD.bazel b/modules/boost.url/1.87.0/overlay/BUILD.bazel
new file mode 100644
index 00000000000..2eead1a79cb
--- /dev/null
+++ b/modules/boost.url/1.87.0/overlay/BUILD.bazel
@@ -0,0 +1,53 @@
+load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
+
+cc_library(
+    name = "boost.url",
+    srcs = glob([
+        "src/**/*.cpp",
+        "src/**/*.hpp",
+    ]),
+    hdrs = glob(["include/**/*.hpp"]),
+    includes = ["include"],
+    local_defines = select({
+        "@platforms//os:windows": ["BOOST_URL_NO_LIB=1"],
+        "//conditions:default": [],
+    }),
+    visibility = ["//visibility:public"],
+    deps = [
+        "@boost.align",
+        "@boost.assert",
+        "@boost.config",
+        "@boost.core",
+        "@boost.mp11",
+        "@boost.optional",
+        "@boost.static_assert",
+        "@boost.system",
+        "@boost.throw_exception",
+        "@boost.type_traits",
+        "@boost.variant2",
+    ],
+)
+
+cc_library(
+    name = "boost.url_test_lib",
+    testonly = True,
+    srcs = [
+        "extra/test_main.cpp",
+        "extra/test_suite.hpp",
+    ],
+    includes = ["extra"],
+    deps = [
+        ":boost.url",
+        "@boost.container",
+        "@boost.filesystem",
+    ],
+)
+
+cc_test(
+    name = "boost.url_test",
+    srcs = glob([
+        "test/unit/*.cpp",
+        "test/unit/*.hpp",
+    ]),
+    deps = [":boost.url_test_lib"],
+)
diff --git a/modules/boost.url/1.87.0/overlay/MODULE.bazel b/modules/boost.url/1.87.0/overlay/MODULE.bazel
new file mode 120000
index 00000000000..9b599e3ad9c
--- /dev/null
+++ b/modules/boost.url/1.87.0/overlay/MODULE.bazel
@@ -0,0 +1 @@
+../MODULE.bazel
\ No newline at end of file
diff --git a/modules/boost.url/1.87.0/presubmit.yml b/modules/boost.url/1.87.0/presubmit.yml
new file mode 100644
index 00000000000..2a58b5a6e51
--- /dev/null
+++ b/modules/boost.url/1.87.0/presubmit.yml
@@ -0,0 +1,22 @@
+matrix:
+  platform:
+    - debian11
+    - ubuntu2004
+    - ubuntu2204
+    - ubuntu2404
+    - macos
+    - macos_arm64
+    - windows
+  bazel: [7.x, 8.x, rolling]
+tasks:
+  verify_targets:
+    platform: ${{ platform }}
+    bazel: ${{ bazel }}
+    build_flags:
+      - "--process_headers_in_dependencies"
+    build_targets:
+      - "@boost.url//:boost.url"
+    test_flags:
+      - "--process_headers_in_dependencies"
+    test_targets:
+      - "@boost.url//:boost.url_test"
diff --git a/modules/boost.url/1.87.0/source.json b/modules/boost.url/1.87.0/source.json
new file mode 100644
index 00000000000..71ed286a733
--- /dev/null
+++ b/modules/boost.url/1.87.0/source.json
@@ -0,0 +1,9 @@
+{
+    "url": "https://github.com/boostorg/url/archive/refs/tags/boost-1.87.0.tar.gz",
+    "integrity": "sha256-f9CegJmi9a0pXqphhgvGQy9+6xNv0O5E1WzbHwkeOhQ=",
+    "strip_prefix": "url-boost-1.87.0",
+    "overlay": {
+        "BUILD.bazel": "sha256-YeqMDvNFmLAvupvetrasBNpXMHpkHlKTbByYeLOwXIo=",
+        "MODULE.bazel": "sha256-VbuhcjFRAZjN8sUnYXrR1q2UeX7NXS058W8jX+23rDk="
+    }
+}
diff --git a/modules/boost.url/metadata.json b/modules/boost.url/metadata.json
index 6decb6d46b5..81f3690d8c4 100644
--- a/modules/boost.url/metadata.json
+++ b/modules/boost.url/metadata.json
@@ -21,7 +21,8 @@
         "github:boostorg/url"
     ],
     "versions": [
-        "1.83.0"
+        "1.83.0",
+        "1.87.0"
     ],
     "yanked_versions": {}
 }


Reviews:
user: login: wep21
state: DISMISSED
author_association: CONTRIBUTOR
submitted_at: 2025-03-11T02:20:39Z
user: login: fmeum
state: DISMISSED
author_association: CONTRIBUTOR
submitted_at: 2025-03-11T05:05:44Z
user: login: Vertexwahn
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-11T21:41:55Z
user: login: vtsao-openai
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-11T21:59:01Z
user: login: wep21
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-03-12T07:34:28Z
user: login: bazel-io
body: Hello @bazelbuild/bcr-maintainers, all modules in this PR have been approved by their maintainers. This PR will be merged if all presubmit checks pass.
state: APPROVED
author_association: MEMBER
submitted_at: 2025-03-12T07:39:54Z

Review comments:
diff_hunk: @@ -0,0 +1,17 @@
+module(
+    name = "boost.sort",
+    version = "1.87.0",
+    bazel_compatibility = [">=7.2.1"],  # need support for "overlay" directory
+    compatibility_level = 108700,
+)
+
+bazel_dep(name = "boost.config", version = "1.87.0")
+bazel_dep(name = "boost.core", version = "1.87.0")
+bazel_dep(name = "boost.range", version = "1.87.0")
+bazel_dep(name = "boost.static_assert", version = "1.87.0")
+bazel_dep(name = "boost.type_traits", version = "1.87.0")
+bazel_dep(name = "rules_cc", version = "0.1.1")
+
+# For tests
+bazel_dep(name = "boost.test", version = "1.87.0")
path: modules/boost.sort/1.87.0/MODULE.bazel
user: login: Vertexwahn
body: In the case of a dev dependency set `dev_dependency=True`, i.e. `bazel_dep(name = "boost.test", version = "1.87.0", dev_dependency=True)`
created_at: 2025-03-11T21:41:54Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,17 @@
+module(
+    name = "boost.sort",
+    version = "1.87.0",
+    bazel_compatibility = [">=7.2.1"],  # need support for "overlay" directory
+    compatibility_level = 108700,
+)
+
+bazel_dep(name = "boost.config", version = "1.87.0")
+bazel_dep(name = "boost.core", version = "1.87.0")
+bazel_dep(name = "boost.range", version = "1.87.0")
+bazel_dep(name = "boost.static_assert", version = "1.87.0")
+bazel_dep(name = "boost.type_traits", version = "1.87.0")
+bazel_dep(name = "rules_cc", version = "0.1.1")
+
+# For tests
+bazel_dep(name = "boost.test", version = "1.87.0")
path: modules/boost.sort/1.87.0/MODULE.bazel
user: login: vtsao-openai
body: Hum, does that work with the presubmits running the tests as a bazel dep like `@boost.url//:boost.url_test`? Marking this as `dev_dependency` means this will only be included if this `MODULE.bazel` file is the root one, which I'm not sure it is in the CI environment?

I just tried it and looks like it doesn't work.
created_at: 2025-03-11T21:59:00Z
author_association: CONTRIBUTOR

PR comments:
user: login: bazel-io
created_at: 2025-03-11T02:09:04Z
body: Hello @wep21, @Vertexwahn, modules you maintain (boost.foreach, boost.parameter, boost.sort, boost.url) have been updated in this PR.
      Please review the changes. You can view a diff against the previous version in the "Generate module diff" check.
author_association: MEMBER
user: login: bazel-io
created_at: 2025-03-11T02:09:05Z
body: Hello @bazelbuild/bcr-maintainers, modules (boost.url) have been updated in this PR.
        Please review the changes. You can view a diff against the previous version in the "Generate module diff" check.
author_association: MEMBER
user: login: vtsao-openai
created_at: 2025-03-11T02:09:13Z
body: @bazel-io skip_check unstable_url
author_association: CONTRIBUTOR
user: login: vtsao-openai
created_at: 2025-03-11T21:25:29Z
body: Had to make some minor tweaks, CI is passing now, PTAL.
author_association: CONTRIBUTOR
user: login: vtsao-openai
created_at: 2025-03-11T23:43:44Z
body: cc @lalten since I see you're also upgrading some Boost libs.
author_association: CONTRIBUTOR
user: login: bazel-io
created_at: 2025-03-11T23:46:52Z
body: Hello @wep21, @Vertexwahn, modules you maintain (boost.foreach, boost.sort, boost.url) have been updated in this PR.
      Please review the changes. You can view a diff against the previous version in the "Generate module diff" check.
author_association: MEMBER
user: login: vtsao-openai
created_at: 2025-03-11T23:48:43Z
body: Removed `boost.parameter` from this PR since it was done in https://github.com/bazelbuild/bazel-central-registry/pull/3989.
author_association: CONTRIBUTOR