Skip to content

Introduce a stub bazel wrapper for Windows #1201

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
merged 1 commit into from
Mar 12, 2025

Conversation

yukawa
Copy link
Collaborator

@yukawa yukawa commented Feb 27, 2025

Description

This is a preparation before starting using clang-cl to build Mozc for for Windows with Bazel (#1179).

In order to make the build process reliable and reproducible, we would like to download a specific version of LLVM with update_deps.py then deploy it under third_party/llvm/ and let rules_cc use it by specifying BAZEL_LLVM environment variable.

To automate this process, one idea is to use tools/bazel wrapper script.

Luckily the wrapper script directory is also customizable since bazelisk v1.21.0.

With above this commit introduces a stub bazel.bat so that we can use it to set various environment variables for Windows bazel build in subsequent commits. At this moment there must be no difference in the final artifacts. There should be no impact on non-Windows bazel build as bazel.bat is searched only on Windows.

Issue IDs

Steps to test new behaviors (if any)

  • OS: Windows 11 24H2
  • Steps:
    1. bazelisk --bazelrc=windows.bazelrc build package --config oss_windows --config release_build
    2. Confirm the build succeeds.

@yukawa yukawa force-pushed the bazel_tool branch 4 times, most recently from f2c9ea1 to be3600b Compare February 27, 2025 09:45
@yukawa yukawa changed the title Introduce a stub bazel_wrapper/bazel.bat Introduce a stub bazel wrapper for Windows Feb 27, 2025
@yukawa yukawa force-pushed the bazel_tool branch 3 times, most recently from f79d96f to 6392f84 Compare March 6, 2025 04:08
@yukawa
Copy link
Collaborator Author

yukawa commented Mar 6, 2025

Rebased to address merge conflict.

This is a preparation before starting using 'clang-cl' to build Mozc for
for Windows with Bazel (google#1179).

In order to make the build process reliable and reproducible, we would
like to download a specific version of LLVM with 'update_deps.py' then
deploy it under 'third_party/llvm/' and let 'rules_cc' use it by
specifying 'BAZEL_LLVM' environment variable [1].

To automate this process, one idea is to use 'tools/bazel' wrapper
script [2]. Luckily the wrapper script directory is also customizable
since bazelisk v1.21.0 [3].

With above this commit introduces a stub 'bazel.bat' so that we can use
it to set various environment variables for Windows bazel build in
subsequent commits. At this moment there must be no difference in the
final artifacts. There should be no impact on non-Windows bazel build
as 'bazel.bat' is searched only on Windows.

 [1]: https://bazel.build/configure/windows#clang
 [2]: https://github.com/bazelbuild/bazelisk/blob/master/README.md#toolsbazel
 [3]: bazelbuild/bazelisk#567
@hiroyuki-komatsu hiroyuki-komatsu merged commit e453da9 into google:master Mar 12, 2025
1 check passed
@hiroyuki-komatsu
Copy link
Collaborator

We have merged your PR.
Thank you for the contribution!

@yukawa yukawa deleted the bazel_tool branch March 12, 2025 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants