Skip to content

Support MSVC with rule-based toolchain#561

Open
calebzulawski wants to merge 2 commits intobazelbuild:mainfrom
calebzulawski:msvc
Open

Support MSVC with rule-based toolchain#561
calebzulawski wants to merge 2 commits intobazelbuild:mainfrom
calebzulawski:msvc

Conversation

@calebzulawski
Copy link
Copy Markdown

Based on #436, but contains the full MSVC implementation.

@armandomontanez
Copy link
Copy Markdown
Collaborator

Wow, this is AWESOME! I'd like to help get this landed in the next week. At first glance this looks pretty good, need to spend a bit more time to look through the rest.

@cerisier
Copy link
Copy Markdown
Contributor

We're also very interested as part of https://github.com/cerisier/toolchains_llvm_bootstrapped !

Copy link
Copy Markdown
Collaborator

@armandomontanez armandomontanez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the radio silence. This is awesome work. Posting my initial concern, but I need to do a bit of a deeper dive to make sure the foundational bits are double-checked.

Comment thread cc/toolchains/compiler/BUILD Outdated
@@ -0,0 +1,33 @@
load("//cc/toolchains:feature.bzl", "cc_feature")

package(default_visibility = ["//visibility:public"])
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is one piece that jumped out at me. Hyrum's law will likely immediately take effect and people will start depending on these. I think something roughly like this should exist, but I don't want to slip in subtly as part of a larger change.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, yeah that makes sense. It's possible that by not providing this, people will instead use the underlying compiler_ feature names to make compiler-specific args, but I figure that's fine for now.

cc_args_for_compiler(
name = "output_execpath_windows",
actions = ["//cc/toolchains/actions:ar_actions"],
args = ["/OUT:{output_execpath}"],
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When using llvm-ar, this fails with:

external/llvm++_repo_rules+llvm-toolchain-minimal-22.1.0-darwin-arm64/bin/llvm-ar: error: unknown option /
OVERVIEW: LLVM Archiver

USAGE: llvm-ar [options] [-]<operation>[modifiers] [relpos] [count] <archive> [files]
       llvm-ar -M [< mri-script]
[...]

I'm ensure if that should be tweaked at the toolchain code level, or in that rules_cc one. Please advise.

@armandomontanez armandomontanez added type: feature request Request for new, generally useful functionality that is missing P2 We'll consider working on this in future. (Assignee optional) platform: windows category: toolchains labels Mar 26, 2026
@hvadehra hvadehra removed their request for review April 21, 2026 04:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: toolchains P2 We'll consider working on this in future. (Assignee optional) platform: windows type: feature request Request for new, generally useful functionality that is missing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants