Skip to content

cc: rules_dx clang-cl toolchains set LIB on MSVC link actions (part of #11416) - #12667

Merged
TrapsterDK merged 3 commits into
mainfrom
issue-11416-clang-cl-lib
Nov 14, 2026
Merged

TrapsterDK merged 3 commits into
mainfrom
issue-11416-clang-cl-lib

Conversation

@TrapsterDK

@TrapsterDK TrapsterDK commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #11416. This is option 2 from the owner decision: rules_dx declares its own clang-cl toolchains so that consumers get the hermetic LIB on MSVC link actions.

Changes

  • New //cc/private/toolchain/clang_cl. It declares one clang-cl cc_toolchain per LLVM exec platform for MSVC targets, using @llvm//toolchain:cc_toolchain.bzl, the @llvm args, the resource directory macros and the minimal-distribution binaries.
    • Its clang-cl cc_tool has no LIB tool env.
    • LIB comes from link-action cc_args that join the Windows SDK, MSVC CRT and libc++ lib dirs with the same per-runtime-stage and CRT selection the patch used.
    • Non-MSVC configurations fall back to the @llvm tool map.
  • The new toolchains are registered just before @llvm//toolchain:all.
  • Deleted the root-only patches/llvm/msvc_link_lib_env.patch and its README row.

Evidence

  • Linux: bazel build //cc/private/toolchain/clang_cl:all passes.
  • windows_x86_64 c_msvc_fixture_test: run 43548456220 passed.
  • windows_x86_64 //tools/testing/hermetic:cpp_rust: run 43548747693 failed before linking. The fetch_coverage probe failed analysing @@rules_dx+//gazelle/julia (no such attribute 'package_name' in 'julia_binary' rule). This PR does not touch that file.

Not run

  • tools/dx check --affected timed out after 20 minutes locally.
  • Consumer and nested-Bazel tests were not run locally; CI runs them.

Remaining

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hws3L7Tg4oUvpSvuYD

@TrapsterDK TrapsterDK added the needs-review Touches review paths; needs a second-session Review: comment label Nov 14, 2026
@TrapsterDK
TrapsterDK marked this pull request as ready for review November 14, 2026 03:01
TrapsterDK and others added 3 commits November 14, 2026 04:01
…#11416)

Declares clang-cl cc_toolchains for MSVC targets in
//cc/private/toolchain/clang_cl that reuse the @llvm cc_toolchain macro,
args and binaries, with a clang-cl cc_tool without the placeholder LIB
env and LIB cc_args from the hermetic Windows SDK, MSVC CRT and libc++
lib dirs. Registered ahead of @llvm//toolchain:all so consumers get the
same link environment. Drops the root-only msvc_link_lib_env llvm patch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hws3L7Tg4oUvpSvuYD
…init on Windows (part of #11416)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hws3L7Tg4oUvpSvuYD
…name (part of #11416)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hws3L7Tg4oUvpSvuYD
@TrapsterDK
TrapsterDK force-pushed the issue-11416-clang-cl-lib branch from 4c54c32 to ff67bb1 Compare November 14, 2026 03:02
@TrapsterDK
TrapsterDK merged commit b3f7c79 into main Nov 14, 2026
1 check failed
@TrapsterDK
TrapsterDK deleted the issue-11416-clang-cl-lib branch November 14, 2026 03:16
@github-actions

Copy link
Copy Markdown
Contributor

This pull request touched paths in .github/review-paths.txt and was merged without a Review: comment. See CONTRIBUTING.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-review Touches review paths; needs a second-session Review: comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant