Define cc-compiler-darwin in Xcode toolchain #14796
Define cc-compiler-darwin in Xcode toolchain #14796fmeum wants to merge 1 commit intobazelbuild:masterfrom
Conversation
This reverts commit 42f4f91. No longer needed as the root cause of the failures has likely been determined and will be fixed by bazelbuild/bazel#14796
|
cc @keith |
This reverts commit 42f4f91. No longer needed as the root cause of the failures has likely been determined and will be fixed by bazelbuild/bazel#14796
6a716d6 to
de84788
Compare
This reverts commit 42f4f91. No longer needed as the root cause of the failures has likely been determined and will be fixed by bazelbuild/bazel#14796
|
looks like this is on the right track, but i guess one is still sneaking in |
537baa5 to
d7c3dfd
Compare
d7c3dfd to
f5ff0fe
Compare
I pushed a new approach. The problem is that |
5732d9a to
f5ff0fe
Compare
|
Hi Keith, Does it still make sense to merge this? |
|
@keith I'm still seeing CI failures related to this: It's hard to verify that this PR would fix the issue, but it seems likely. |
|
I don't think this PR will fix that issue, but where is the bad CPU value sneaking in from? It seems like we might want to fix that or this could cause other issues? |
|
@keith If I remember running into some issues when changing the return value of |
Where is this happening? The only cpu_value I see being passed around comes from get_cpu_name |
This does seem like it would be preferred since IMO |
Those are indeed the only CPU values passed around, but when |
|
thanks for catching me up. I would be interested to see if you added x86_64 in the place you linked what the first issue you hit is so we could try to judge what else might be a problem |
f5ff0fe to
aa54435
Compare
|
|
The "empty" toolchain at bazel/tools/cpp/cc_configure.bzl Line 103 in bbf34eb get_cpu_value that would conditionally return the legacy CPU value, but that seems worse to me.
|
|
Where's the empty case defined? Since this line you linked would return your new value correctly right? |
It returns the new one and emits it into bazel/tools/cpp/BUILD.empty.tpl Line 31 in bbf34eb But that test seems to exercise the legacy toolchain resolution, which then looks for a match for the legacy CPU value darwin (the value of --cpu as determined by AutoCpuConverter) and can't find one as the only available cpu type is darwin_x86_64. Changing the return value of AutoCpuConverter to match darwin_x86_64 would probably break toolchain resolution for anybody who isn't on platforms yet.
|
|
That change was attempted in the past and reverted #12918 I'm not sure if there's a good enough reason to try to ship something like that again. Realistically folks shouldn't use |
|
well sorry for all the back and forth just to get to this. I think we should commit your original alias for now |
Previously, if the xcode_locator failed and cc_autoconf_toolchain used the non-Xcode C++ toolchain as a fallback, its reference to @local_config_cc//:cc-compiler-darwin, where darwin is the legacy cpu value for x86_64 macOS, would be invalid.
35aef3c to
4fca2bf
Compare
|
@keith No worries, thanks for taking the time to go through the possible alternatives with me. I'm also interested in merging something that will stick and doesn't complicate the situation unnecessarily. I force pushed the alias version of the PR. |
|
@keith Who would be responsible for importing and merging? |
|
@googlewalt Friendly ping |
|
@bazel-io flag |
|
@ckolli5 Could this still be cherry-picked into 5.2.0? It's a very small change and users run into the issue frequently. |
|
@bazel-io fork 5.3.0 |
Previously, if the xcode_locator failed and cc_autoconf_toolchain used the non-Xcode C++ toolchain as a fallback, its reference to `@local_config_cc//:cc-compiler-darwin`, where darwin is the legacy cpu value for x86_64 macOS, would be invalid. Fixes #14459 Closes #14796. PiperOrigin-RevId: 451860477 Change-Id: Iec115f600ebb7ac0786b2169276d25e3ff5d54bf Co-authored-by: Fabian Meumertzheim <[email protected]>
Previously, if the xcode_locator failed and cc_autoconf_toolchain used
the non-Xcode C++ toolchain as a fallback, its reference to
@local_config_cc//:cc-compiler-darwin, where darwin is the legacy cpuvalue for x86_64 macOS, would be invalid.
Fixes #14459