-
Notifications
You must be signed in to change notification settings - Fork 409
Rely on CC toolchain resolution on Windows Bazel builds #1156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is a follow up commit to my previous commit [1], which updated the Bazel version from 7.4.1 to 8.0.0 (google#1118). It turns out that --noincompatible_enable_cc_toolchain_resolution is now no-op in Bazel 8.0. Thus we have no other choice than fully migrating to the new CC toolchain resolution as planned in google#1112. Otherwise 'mozc_tip32.dll' will be built as a 64-bit executable (google#1102). This commit consists of two parts: 1. explicitly register CC toolchains in '.bazelrc'. 2. Switch from '--cpu' commandline option to '--platforms' commandline option in '_win_executable_transition'. With above 'mozc_tip32.dll' will be built as a 32-bit executable again. Closes google#1102. Closes google#1112. [1]: 6dadef1
We have merged your PR. |
yukawa
added a commit
to yukawa/mozc
that referenced
this pull request
Jan 20, 2025
This reworks my previous PR google#1156 [1] to make Windows bazel build compatible with --noincompatible_enable_cc_toolchain_resolution option, which is now unconditionally enabled (google#1102) (google#1112). The difference from the previous approach is that this commit uses CC toolchains defined by 'rules_cc' rather than the ones implicitly defined by the Bazel itself. Given that 'rules_cc' becomes the new home of CC-related rules and configurations, hopefully this change will reduce the likelihood of future troubles. There must be no observable behavior change in the final artifacts. [1]: 4aad25e
yukawa
added a commit
to yukawa/mozc
that referenced
this pull request
Jan 20, 2025
This reworks my previous PR google#1156 [1] to make Windows bazel build compatible with --noincompatible_enable_cc_toolchain_resolution option, which is now unconditionally enabled (google#1102) (google#1112). The difference from the previous approach is that this commit uses CC toolchains defined by 'rules_cc' rather than the ones implicitly defined by the Bazel itself. Given that 'rules_cc' becomes the new home of CC-related rules and configurations, hopefully this change will reduce the likelihood of future troubles. There must be no observable behavior change in the final artifacts. [1]: 4aad25e
yukawa
added a commit
to yukawa/mozc
that referenced
this pull request
Jan 21, 2025
This reworks my previous PR google#1156 [1], which was to make Windows bazel build compatible with --noincompatible_enable_cc_toolchain_resolution option (google#1102) (google#1112). The difference from the previous approach is that this commit uses CC toolchains defined by 'rules_cc' rather than the ones implicitly defined by the Bazel itself. Given that 'rules_cc' becomes the new home of CC-related rules and configurations, hopefully this change will reduce the likelihood of future troubles. There must be no observable behavior change in the final artifacts. [1]: 4aad25e
yukawa
added a commit
to yukawa/mozc
that referenced
this pull request
Jan 21, 2025
This reworks my previous PR google#1156 [1], which was to make Windows bazel build compatible with --noincompatible_enable_cc_toolchain_resolution option (google#1102) (google#1112). The difference from the previous approach is that this commit uses CC toolchains defined by 'rules_cc' rather than the ones implicitly defined by the Bazel itself. Given that 'rules_cc' becomes the new home of CC-related rules and configurations, hopefully this change will reduce the likelihood of future troubles. There must be no observable behavior change in the final artifacts. [1]: 4aad25e
yukawa
added a commit
to yukawa/mozc
that referenced
this pull request
Jan 21, 2025
This reworks my previous PR google#1156 [1], which was to make Windows bazel build compatible with --noincompatible_enable_cc_toolchain_resolution option (google#1102) (google#1112). The difference from the previous approach is that this commit uses CC toolchains defined by 'rules_cc' rather than the ones implicitly defined by the Bazel itself. Given that 'rules_cc' becomes the new home of CC-related rules and configurations, hopefully this change will reduce the likelihood of future troubles. There must be no observable behavior change in the final artifacts. [1]: 4aad25e
hiroyuki-komatsu
pushed a commit
that referenced
this pull request
Jan 21, 2025
This reworks my previous PR #1156 [1], which was to make Windows bazel build compatible with --noincompatible_enable_cc_toolchain_resolution option (#1102) (#1112). The difference from the previous approach is that this commit uses CC toolchains defined by 'rules_cc' rather than the ones implicitly defined by the Bazel itself. Given that 'rules_cc' becomes the new home of CC-related rules and configurations, hopefully this change will reduce the likelihood of future troubles. There must be no observable behavior change in the final artifacts. [1]: 4aad25e PiperOrigin-RevId: 717738755
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This is a follow up commit to my previous commit (6dadef1), which updated the Bazel version from 7.4.1 to 8.0.0.
It turns out that
--noincompatible_enable_cc_toolchain_resolution
is now no-op in Bazel 8.0. Thus there remains no way other than fully migrating to the new CC toolchain resolution as planned.--noincompatible_enable_cc_toolchain_resolution
in Windows build #1112Otherwise
mozc_tip32.dll
will be built as a 64-bit executable.mozc_tip32.dll
build with Bazel is not 32-bit binary #1102This commit consists of two parts:
.bazelrc
.--cpu
commandline option to--platforms
commandline option in_win_executable_transition
.With above
mozc_tip32.dll
will be built as a 32-bit executable again.Closes #1102.
Closes #1112.
Issue IDs
mozc_tip32.dll
build with Bazel is not 32-bit binary #1102--noincompatible_enable_cc_toolchain_resolution
in Windows build #1112Steps to test new behaviors (if any)
Mozc64.msi
with BazelMozc64.msi
dumpbin /headers "C:\Program Files (x86)\Mozc\mozc_tip32.dll" | findstr machine
14C machine (x86)
is shown.