Repository navigation
Lower minimum OCaml version from 5.1 to 4.11 - #20
Conversation
614b3c5 to
3e51703
Compare
3e51703 to
79b2f7f
Compare
|
Note: this must not be merged-and-released as-is. The opam-repository CI for the previous release (xgboost.0.2.2) is failing, and the root cause is a latent bug in code this PR ships unchanged. On workers without a system PR20's own CI is green only because GitHub-hosted runners are ~4 vCPU, so the fallback builds at Fix needed before merge/release: cap the vendored build parallelism. Full diagnosis and ongoing discussion with @mseri: ocaml/opam-repository#30964 (comment) |
The library and its FFI stack were already 4.x-compatible. The only OCaml 5-only use was Domain.recommended_domain_count in the build configurator (config/discover.ml), which selected the -j count for the vendored CMake fallback. Replace it with a shell-out to `getconf _NPROCESSORS_ONLN` (falling back to `nproc --all`), both of which report online CPUs while ignoring OMP_NUM_THREADS (pinned to 1 in CI) and are compiler-independent. Lower the (ocaml (>= ...)) bound to 4.11 in dune-project and both hand-maintained .opam files, and extend the CI matrix so the oldest supported compiler (4.11) exercises both the system fast path and the vendored CMake fallback. 4.11 is the oldest compiler still carried by the default opam-repository. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Domain.recommended_domain_count was the only OCaml 5-only use in the build, and it pinned the package to OCaml >= 5. Use the same approach as #20: getconf _NPROCESSORS_ONLN, falling back to nproc --all (both ignore OMP_NUM_THREADS), still capped at 6 jobs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
79b2f7f to
677eea0
Compare
|
Addressed by 0.2.3 ( |
Domain.recommended_domain_count was the only OCaml 5-only use in the build, and it pinned the package to OCaml >= 5. Use the same approach as #20: getconf _NPROCESSORS_ONLN, falling back to nproc --all (both ignore OMP_NUM_THREADS), still capped at 6 jobs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Domain.recommended_domain_count was the only OCaml 5-only use in the build, and it pinned the package to OCaml >= 5. Use the same approach as #20: getconf _NPROCESSORS_ONLN, falling back to nproc --all (both ignore OMP_NUM_THREADS), still capped at 6 jobs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
Lowers the supported OCaml floor from 5.1 to 4.11 for both packages.
The library and its FFI stack were already 4.x-compatible. The only OCaml 5-only use was
Domain.recommended_domain_countin the build configurator (config/discover.ml), used to pick the-jcount for the vendored CMake fallback. It now shells out togetconf _NPROCESSORS_ONLN(falling back tonproc --all) — both report online CPUs, ignoreOMP_NUM_THREADS(pinned to 1 in CI), and are compiler-independent.4.11 is the oldest compiler still carried by the default opam-repository (everything below it has been moved to the archive repo), so it is the lowest floor that is practically installable and CI-testable today.
Changes
config/discover.ml— replaceDomain.recommended_domain_countwith agetconf/nprocshell-out viaC.Process.rundune-project,xgboost.opam,xgboost-bench.opam—(ocaml (>= 4.11))(opam files are hand-maintained;generate_opam_files false).github/workflows/ci.yml— matrix oldest compiler5.1→4.11; the oldest (4.11) and newest (5.5) exercise both the system fast path and the vendored CMake fallback, middle versions run the fast path onlyCHANGES.md— changelog entryVerification
dune build -p xgboostandopam lintpass locally (OCaml 5.5.1, system libxgboost 3.0.4)src/,bin/,config/: no post-4.08 stdlib or syntax features remainctypes/dune-configuratorset, plus the vendored path under 4.11) is validated by CI🤖 Generated with Claude Code