Open gabware opened 1 year ago
Added code to handle default locations for VS installation. Tried to minimize code duplication by generating the list of locations.
Could you please send a PR for this to the copy of the file in bazelbuild/bazel's bazel_tools so that they are less out of sync? Thanks
Sure. Couple questions before I do that:
We're talking about updating https://github.com/bazelbuild/bazel/blob/master/tools/cpp/windows_cc_configure.bzl . Correct?
Yes.
How do I test that I didn't break anything ? What are the targets I should be building ?
We don't test the toolchain files themselves. But if nothing breaks on CI then we're good.
I see there are quite a few differences between the two files. Is it ok if I redo only the changes from this PR? I think it'd be best to avoid potential build break and keep PR small and consistent.
Absolutely, only the changes from this PR. But I'm even starting to hesitate whether you should spend time on that.
@fmeum What did we decide a few months back that should eventually be source of truth? Was it the version in bazel_tools or the one in rules_cc? Do you think it makes sense Gabriel to update both here?
CC @meteorcloudy, who is working on making rules_java
the source of truth for Java toolchains (see https://github.com/bazelbuild/bazel/pull/18423).
Given that, I'm pretty sure the correct answer is rules_cc
.
https://github.com/bazelbuild/bazel/pull/18423 is almost done, and looks like a success. I think we should probably do the same for rules_cc, rules_android to remove more stuff from @bazel_tools
.
@comius @ted-xie
I can take a look at using rules_cc as source of truth after finishing rules_java
Was it the version in bazel_tools or the one in rules_cc?
AFAICT the version in rules_cc
seems cleaner; better maintained. Functions were moved to private, there are a couple fixes in, etc. I believe rules_cc should be the source of truth.
Do you think it makes sense Gabriel to update both here?
Unless I'm mistaken, I'd have to do a different PR because https://github.com/bazelbuild/bazel
is a different repo.
So I won't "update both here" per-se. I'll update both as two PR. (unless there's a way to update both here that I don't know; I'm not super familiar with github yet).
@gabware Yes, I think Pedro meant we should also update the toolchain configuration in the Bazel repo to keep this in sync until we actually switch to rules_cc as the source of truth (meaning loading toolchains from rules_cc by default in Bazel)
Sounds like we can get this in then.
Anything left here or can we merge this ?
This only handles cases where the user explicitely set BAZEL_VC through the environment. Handling BAZEL_VS will require more changes I think. LMKWYT.