ocaml / ocaml/setup-ocaml

clang-cl support

Open
#1,073 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
228
Forks
48
Avg merge
15m
Merged PRs (30d)
10

Description

Add clang-cl as a compiler option on Windows. clang-cl is a drop-in replacement for cl.exe that uses LLVM/Clang with an MSVC-compatible interface, and is pre-installed on GitHub-hosted runners as part of the Visual Studio LLVM toolset (VC.Llvm.Clang).

Unlike MSVC which is cleanly handled by opam through the msvs-detectconf-msvc64ocaml-env-msvc64 chain, there is currently no opam-level mechanism for clang-cl. Setting CC=clang-cl globally in setup-ocaml would affect all package builds, not just the OCaml compiler itself.

This is blocked on upstream opam support — a system-clang-cl package or an option package that scopes CC=clang-cl to the opam build environment would be the proper approach. See discussion in #950 (https://github.com/ocaml/setup-ocaml/issues/950#issuecomment-4103754883).

Related: #950

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the discussion in #950, especially the linked comment, and review how setup-ocaml currently handles the msvs-detect, conf-msvc64, and ocaml-env-msvc64 chain. Confirm the upstream opam support needed for clang-cl and define completion as a compiler-only clang-cl option that does not change CC for other package builds.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, ocaml
Domain
build-system, ci-cd, compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.