Skip to content

ocaml: conda-ocaml-* drivers and dune steps run as dx (part of #13154, part of #13770) - #14208

Merged
TrapsterDK merged 1 commit into
mainfrom
ocaml-cc-driver-dx
Nov 20, 2026
Merged

TrapsterDK merged 1 commit into
mainfrom
ocaml-cc-driver-dx

Conversation

@TrapsterDK

Copy link
Copy Markdown
Collaborator

Part of #13154, part of #13770

  • cli/ocaml_cc_driver is now a rust_library exposing run_tool(argv0, args) and run_dune(args); driver::run takes argv0/args instead of reading std::env.
  • dx dispatches the exact names conda-ocaml-{ar,as,cc,ld,mkdll,mkexe,ranlib} (argv[0] file stem) and the ocaml_dune subcommand.
  • ocaml/private/toolchain/ocaml.bzl and ocaml/private/dune.bzl use _dx = @dx_prebuilt//:dx; cc_drivers symlinks the conda-ocaml-* names to dx; dune actions run dx ocaml_dune MODE ....
  • New analysis test //ocaml/tests/fixtures/dune_lib:farewell_runs_dx_test.
  • api/starlark.json is also regenerated: main was already stale after julia: carry rules_julia#49 entry instead of package_name.patch (part of #11418, part of #6659) #14196 (julia entry attr), which made //tools/api:api_test fail.

msvc_link_exec cannot become a dx subcommand: dx itself links through it on Windows opt builds, so -Clinker=dx is a cycle whenever dx builds from source. It needs its own asset in cli/prebuilt/tools.bzl.

Verified (linux_x86_64):

  • bazel test //cli/ocaml_cc_driver:all //cli/cli:dx_cli_test //ocaml/tests/...: 51 pass, 4 skipped (incompatible); this includes greet_dune_native_test.
  • bazel test //tools/api:all: pass.
  • bazel build //ocaml:dune //ocaml/private/quality:all //ocaml/private/coverage:all: OK. Wall time after the change was 25.7s (critical path 24.0s). I did not measure the before time separately.
  • bazel cquery 'somepath(//cli/cli:dx, //ocaml/private/toolchain:dune)': empty.
  • tools/dx check --affected did not finish within the time budget and was stopped. rustfmt on the touched Rust files is clean.
  • Nested-Bazel and *_consumer_test targets were not run locally.

Still open:

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hvgPbKqbuDgsTasg7K

… part of #13770)

ocaml_cc_driver becomes a library linked into dx. dx runs it under the
conda-ocaml-{ar,as,cc,ld,mkdll,mkexe,ranlib} argv[0] names and as
`dx ocaml_dune`; the OCaml rules point at @dx_prebuilt//:dx.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hvgPbKqbuDgsTasg7K
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.

1 participant