Skip to content

or-tools: use the registry's zlib, bzip2, abseil-cpp, protobuf, re2 and boost - #1541

Merged
bryan-minimal merged 6 commits into
mainfrom
or-tools-system-deps
Nov 18, 2026
Merged

bryan-minimal merged 6 commits into
mainfrom
or-tools-system-deps

Conversation

@bryan-minimal

Copy link
Copy Markdown
Member

Draft: not built anywhere yet. The build on this PR is the first test.

Problem

or-tools is built with BUILD_DEPS=ON, so it compiles and installs its own copy of every dependency. Six of those are packages of this registry, and or-tools' copies land at the same paths with different contents. From the amd64 file lists of pkgs b891179 (every package tarball read, 2026-11-17):

or-tools against paths that differ
boost 1,309
abseil-cpp 480
protobuf 209
re2 5
zlib 4
bzip2 2

That is 8 of the 36 package pairs in the catalog that hold different files at one path. Under the conflict rule of the registry proposal (gominimal/arch#183, model section 12), or-tools could not share a box with any of them. Today the file that is linked first wins, silently.

Change

  • BUILD_DEPS=OFF, with BUILD_ZLIB, BUILD_BZip2, BUILD_absl, BUILD_Protobuf, BUILD_re2 and BUILD_Boost off: or-tools finds the registry's packages.
  • Still built by or-tools, because the registry has no package for them: Eigen (from the pinned mirror, as before), HiGHS, SCIP, soplex and the COIN-OR solvers.
  • The six packages become build deps and runtime deps (boost as its libs subset: soplex uses multiprecision and serialization).
  • The mirrored BZip2 source and its patch step are removed.
  • Two fail-closed checks in build.sh: or-tools built none of the six itself, and none of their files were installed into this package.

Risks, all untested

  • Versions. or-tools 9.15 pins abseil 20250814.1, protobuf v33.1, re2 2025-08-12, boost 1.87 and zlib 1.3.1. The registry has abseil 20260817.0, protobuf 36.2, re2 2025-11-05, boost 1.92 and zlib 1.4. Its find_package calls ask for no version, so it will try; whether it compiles against protobuf 36 and the newer abseil is not known.
  • Patches. or-tools applies its own patches to abseil, protobuf, re2 and boost when it builds them. With the registry's packages those are not applied. I did not read what each patch does.
  • bzip2. or-tools used BZip2 master for its CMake support; the registry's bzip2 is 1.0.8, found through CMake's own FindBZip2.
  • Runtime deps. The list is my reading, not a result. The missing-runtime_deps check on this PR is the test.

Not in this PR

🤖 Generated with Claude Code

…nd boost

or-tools built and installed its own copies of six libraries the registry
already packages, at the same paths with different contents. It now builds
against the packages (BUILD_DEPS=OFF) and still builds the solvers and
Eigen itself, which the registry does not package.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

  • Run on-demand review

This review includes 2 billable files and costs up to $0.50.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 50 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 63 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between b891179 and c6b1e2a.

Files selected for processing: 2

  • packages/or-tools/build.ncl
  • packages/or-tools/build.sh
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

bryan-minimal and others added 5 commits November 17, 2026 08:07
…ckage

or-tools' SoPlex patch stops at configure unless Boost::multiprecision and
Boost::serialization exist, and only or-tools' own Boost build defines them.
Define both from the registry's boost through CMAKE_PROJECT_ortools_INCLUDE.

Diagnosis by the pkgmgr-rs-a2 session from the build log of 6c622f3.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
or-tools 9.15 defines absl::SourceLocation itself for the abseil it pins.
The abseil package (20260817) has the real one, so the name was ambiguous
in every file that includes absl/status/status.h. The or-tools header now
forwards to abseil's.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The "enumerate bins" check wants each binary named: fzn-cp-sat, highs,
sat_runner, scip, solve, vector_bin_packing.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
libortools*.so* was in both `libortools` and `libs`. Listing from the arm64
artifact of run 617e8987 (by the pkgmgr-rs-a2 session); amd64 not checked.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Whether minimal refuses a file that matches no output is not known, so
build.sh checks the installed libraries against the two output globs.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

@norrietaylor norrietaylor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Scope is wider than the title and the body. Three commits split bins into six outputs, name the libs libraries one by one, and add a shared-library check. The PR body does not describe them. They are small and coherent with the stated arch#183 goal.

Clobber none. git log on packages/or-tools shows the SCIP TPI patch (#238), the nproc/4 cap (#132) and the Eigen pin (#1146) all stay. The removal of the BZip2 mirror is intended.

Correctness The registry side agrees with the change. boost has a libs output and installs its CMake config. bzip2 installs bzlib.h and libbz2.so. abseil-cpp, protobuf and re2 ship CMake config. The repo already uses brace globs in outputs. No other package imports or-tools, so the removal of the bins output name breaks no subsetOf. One low: no check covers the binaries, although the libraries have one. The other findings are nits.

One line outside the changed lines is now stale. build.sh:127 says protoc needs LD_LIBRARY_PATH, but protoc now comes from the protobuf package.

Not checked, because each needs a build or the or-tools source, which is not in this checkout: that or-tools 9.15 compiles against protobuf 36.2 and abseil 20260817.0, that the project name is ortools for CMAKE_PROJECT_ortools_INCLUDE, that abseil ships absl/types/source_location.h, the list of installed binaries and libraries, and whether the installed SoPlex CMake config refers to Boost::multiprecision. The secrets check was a targeted search of the diff only. gitleaks did not run.

sat_runner = { glob = "usr/bin/sat_runner" } | OutputBin,
scip = { glob = "usr/bin/scip" } | OutputBin,
solve = { glob = "usr/bin/solve" } | OutputBin,
vector_bin_packing = { glob = "usr/bin/vector_bin_packing" } | OutputBin,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

low · The six per-binary outputs replace usr/bin/*, and nothing fails when or-tools installs a seventh binary. That binary drops out of the package without an error. build.sh:146-156 adds this exact check for shared libraries and gives this exact reason. The solvers are fetched live (#1146), so the installed set can change. Add the same loop over $OUTPUT_DIR/usr/bin/* in build.sh. I did not check the installed binary list, because that needs a build. This is the only output-coverage check in the repo, so the fix is local.

zlib,
abseil-cpp,
subsetOf boost ["libs"],
bzip2,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit · The runtime dep is the whole bzip2 package, so its eleven command-line tools come into every box that has or-tools. or-tools needs only libbz2.so. packages/boost/build.ncl:39 already uses subsetOf bzip2 ["libs"]. Use the same here. abseil-cpp and protobuf can stay whole, because the or-tools headers include their headers.

# landed at the same paths as these packages' files with different contents
# (boost 1,309 files, abseil-cpp 480, protobuf 209, re2 5, zlib 4, bzip2 2:
# amd64 file lists of pkgs b8911794), so or-tools and any of them could not
# share a box under the registry spec's conflict rule (gominimal/arch#183).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit · This comment tells the history of the change: what or-tools "used to" do, file counts at one commit, and the proposal that motivated it. That belongs in the PR body, where it already is. Line 40 does the same: "BZip2 came the same way until it became the bzip2 package below." Keep one line that says these are the registry packages or-tools links, which lines 54-55 already say. Delete the rest.

boost,
bzip2,
protobuf,
re2,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit · abseil-cpp, bzip2, protobuf and re2 are in build_deps and also in runtime_deps. The repo guide says every runtime_deps entry is injected into the build, so the build_deps copies do nothing. Keep boost here, because the runtime entry is only its libs subset and the build needs the headers and the CMake config. The existing zlib entry at line 53 has the same duplication.

@bryan-minimal
bryan-minimal added this pull request to the merge queue Nov 18, 2026
Merged via the queue into main with commit b30bbdf Nov 18, 2026
15 checks passed
@bryan-minimal
bryan-minimal deleted the or-tools-system-deps branch November 18, 2026 20:21
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.

2 participants