Repository navigation
Conversation
|
I don't think that we're going to do continuous builds internally on windows + arm64. I'll probably take some patches to make it easier.
If you have clang-cl, why build the rest with msvc? It might be useful if we support clang-cl generally instead of mingw-gcc. |
PR #299 (contributed by Nikhil Dabas) requests Windows + ARM64 builds. We're not ready to do that on our continuous build pipeline, but some of the changes/fixes are reasonable to adopt. Additional cleanups added: - `aws_checksums`: Fix MSVC ARM64 flag typo (`/arch:arm8.1` -> `/arch:armv8.1`). - `libaom`: Gate `-march=armv8*` compiler flags behind non-MSVC so `cl.exe` does not receive unrecognized GCC architecture flags. - `c-blosc`: Move `blosc/win32/pthread.c` from `srcs` to `textual_hdrs` in `:win32` since `blosc/blosc.c` `#include`s it directly on Windows, avoiding duplicate compilation. - `dav1d`, `zlib`, `libaom`, `zstd`, `aws_checksums`, `aws_c_common`, and `libpng`: Fall back to portable C implementations on MSVC ARM64 (`cl.exe` cannot assemble GNU-syntax ARM64 assembly in `dav1d` or compile GCC-specific ARM64 SIMD in Chromium `zlib`), declare `cpu_features.h` in `zlib` `hdrs` for non-SIMD builds, and standardize architecture/compiler selection on `:use_{x86,arm64}_{gcc,msvc}`. - `setup.py`: Pass `/d2FH4-` via `--cxxopt` instead of `--copt` so C translation units compiled with `clang-cl` do not warn on a C++-only exception handling flag. - `local_runtime_repo_setup.bzl`: Disable `supports_build_time_venv` on Windows so `rules_python` links interpreter DLLs (`python3XX.dll`) into runtime venvs, fixing `STATUS_DLL_NOT_FOUND` in `doctest_test` targets. - `bazel_to_cmake`: Add `("Windows", "ARM64")` platform mapping and `may_target_x86()` so `ASM_NASM` is not enabled and `nasm_library` / `nasm_cc_library` emit empty/header-only targets when targeting known non-x86 processors; normalize path types in `variable_substitution_test.py` for Windows. - `bazelisk.py`: Allow `arm64` on Windows for Bazel >= 5.4.0. PiperOrigin-RevId: 1008950701 Change-Id: If338d65f53a769f4f344708970af6fb29845610c
|
If you can rebase off e24c768 I'll look and see what else I can adopt |
|
Excellent, thanks, I'll do that tonight and can also look into building everything with clang-cl. |
02eca53 to
2d998eb
Compare
|
I have rebased on the commit you specified, and have moved the entire Windows ARM64 build to clang-cl, which required a couple of minor fixes. Everything will still build with MSVC for local developer workflows if needed. |
|
I've added more clang-cl build config pieces. |
|
Great, thanks -- I removed the commit and other pieces that have been merged with that, and rebased. Let me know how you'd like to proceed with the rest. |
As the title says -- some notes on the changes:
bazelisk.pynow allowsarm64on Windows.--//:windows_arm64_clang_cl_simdflag inBUILD.bazel, thecc_platform_transition.bzlrule, and a clang-cl platform and toolchain intools/bazel_platforms/BUILD.bazel, registered inWORKSPACE.-marchflags are no longer passed to MSVC./arch:arm8.1is corrected to/arch:armv8.1.runner.arch.win32/pthread.cis now only included intoblosc.c(viatextual_hdrs), not also compiled on its own. It used to be compiled twice, with the duplicate symbols silently tolerated. Now it's compiled once with the same code.dav1dnow wraps a privatedav1d_implNo change for users of the public label. Anything that pointed at dav1d's internal targets would need updating.cpu_features.hdeclared for all builds; Windows-aware defines for the portable path. No behavior change on x64, Linux or macOS. It also fixes a missing header on other non-SIMD platforms.WORKSPACE. Bazel only looks it up when the flag is on. Projects that use TensorStore as a dependency don't get the registration, but the flag is off by default.bazelisk.pypatch -- This vendored file now differs from upstream bazelisk, so re-apply the patch if you update it.Linux, macOS and x86_64 Windows otherwise build the same sources with the same flags, and their CI jobs passed as well.
Some other fixes:
setup.pynow passes/d2FH4-as--cxxoptinstead of--copt. The flag only affects C++ exception handling, so MSVC builds of C++ are unchanged. zlib and dav1d are C, so clang-cl no longer sees the flag.doctest_testtargets (all 7 now pass): Bazel's Python test wrapper uses a venv holding only a symlink topython.exe. Windows can't findpython314.dllfrom there, so Python exited withSTATUS_DLL_NOT_FOUND. Inlocal_runtime_repo_setup.bzl, the local Python runtime now setssupports_build_time_venv = Falseon Windows only. rules_python then creates the venv at runtime and links in Python's DLLs. Linux and macOS are unchanged.variable_substitution_test: It built its paths with backslashes and mixed Windows and posix path types, while the real code uses native path types. I fixed the fixture invariable_substitution_test.py. On Linux the changes do nothing, and allbazel_to_cmaketests now pass.may_target_x86()inplatforms.pyenablesASM_NASMonly when targeting x86, like the existing MSVC-only check forASM_MASM. Unrecognized processor names keep NASM enabled, so other platforms are unaffected.rules_nasm.pygenerates them as empty libraries.config.json. A newrules_nasm_arm64golden test covers the ARM64 output, and the existing x86 golden output is unchanged.