Repository navigation
Fix flambda configure flag and parallel builds for pre-4.08 OCaml - #3
Merged
Merged
Conversation
The IS_AUTOCONF check used arithmetic -eq on strings, so it was always true and always passed --enable-flambda, which the hand-written configure used before OCaml 4.08 rejects. Detect autoconf from configure.ac in the source tree instead. Those older trees also race under make -j, so build them serially. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019UuPJbXuMH8A4DCDNoiBiv
mattgodbolt
approved these changes
Sep 30, 2026
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The targeted changes correctly address the documented legacy build failures without affecting modern builds.
Review effort: Balanced
Findings: None
What changed in this PR
Updates OCaml build handling for legacy compiler releases and flambda variants.
Changes:
- Selects the correct flambda configure flag from the source tree.
- Forces serial builds for pre-autoconf OCaml versions.
| File | Description |
|---|---|
build/build.sh |
Adds version-compatible configuration and build parallelism. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Needed to build the versions added in compiler-explorer/infra#2365 (paired with compiler-explorer/compiler-explorer#9140).
What / why
[[ "x$IS_AUTOCONF" -eq "xyes" ]]does arithmetic comparison on strings, so it was always true and every-flambdabuild passed--enable-flambda. Before 4.08 OCaml has a hand-writtenconfigurethat only accepts-flambda, so 4.05.0 to 4.07.1 flambda builds failed withUnknown option(which is why4.07.1-flambdahas no S3 tarball today). bespoke-build never passes the third arg anyway, so the script now checks the source tree forconfigure.ac(autoconf, 4.08+) instead.make -jraces (cp: cannot create regular file 'boot/ocamlrun': Text file busy,ar: fix_code.o: No such file or directory, ocamldoc.cmxnot yet built). Those trees now build with-j1; 4.08+ keeps-j$(nproc).Testing
Built the image locally and ran
bash build.sh <v> /distfor all 40 targets in infra#2365 that are missing from S3 (3.12.1 through 5.5.1-flambda, including every pre-4.08 one with the final script). For each, extracted the tarball to/opt/compiler-explorer, checked the top dir isocaml-<v>/, ranocaml -version,ocamlopt -version, checkedocamlopt -configreportsflambda: trueonly for-flambdatargets, and compiled and ran a small program withocamlopt. All 40 pass.🤖 Generated with Claude Code