Declare windows_utils.h as a header of cpuinfo on ARM64#467
Open
fmeum wants to merge 1 commit into
Open
Conversation
src/impl_aarch64_windows.c includes "internal/windows_utils.h", but the header is only listed in the hdrs of cpuinfo and cpuinfo_for_testing for x86. As a result, Bazel builds of :cpuinfo for windows-arm64 (e.g. when cross-compiling with clang -target aarch64-w64-windows-gnu) fail with: src/impl_aarch64_windows.c:24:10: fatal error: 'internal/windows_utils.h' file not found
1 task
Collaborator
|
cpu_features/src/impl_aarch64_windows.c Line 24 in 044ec8c |
fmeum
added a commit
to bazel-contrib/platforms_contrib
that referenced
this pull request
Jul 3, 2026
Building with --platforms=@platforms_contrib//host uses a platform that
has @platforms//host as its parent and adds the constraint values from
this module that match the host machine:
* the glibc or musl version available on Linux, detected in Starlark
via getconf/ldd or the musl loader, and
* the available x86-64 CPU features (and thus microarchitecture
levels), detected by running a prebuilt binary built on the
cpu_features library.
Detection runs lazily in a repository rule, so projects that don't
reference //host don't pay for it. On hosts without a prebuilt detector
binary, the platform degrades to the libc constraints with a warning;
PLATFORMS_CONTRIB_HOST_DETECTION=off skips CPU feature detection
entirely.
The prebuilt detectors are cross-compiled for all six supported host
platforms ({linux,macos,windows} x {x86-64,arm64}) with the hermetic
llvm toolchain, following the approach used by
https://github.com/hermeticbuild/codesign.bzl: a prebuilts.yaml
workflow builds //prebuilt:for_all_platforms on prebuilts-v* tags and
publishes the binaries as GitHub release artifacts referenced from
host/private/prebuilts.bzl. Building //prebuilt:detect_cpu for
windows-arm64 requires a patch for cpu_features that has been submitted
upstream as google/cpu_features#467.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
fmeum
added a commit
to bazel-contrib/platforms_contrib
that referenced
this pull request
Jul 3, 2026
Building with --platforms=@platforms_contrib//host uses a platform that
has @platforms//host as its parent and adds the constraint values from
this module that match the host machine:
* the glibc or musl version available on Linux, detected in Starlark
via getconf/ldd or the musl loader, and
* the available x86-64 CPU features (and thus microarchitecture
levels), detected by running a prebuilt binary built on the
cpu_features library.
Detection runs lazily in a repository rule, so projects that don't
reference //host don't pay for it. On hosts without a prebuilt detector
binary, the platform degrades to the libc constraints with a warning;
PLATFORMS_CONTRIB_HOST_DETECTION=off skips CPU feature detection
entirely.
The prebuilt detectors are cross-compiled for all six supported host
platforms ({linux,macos,windows} x {x86-64,arm64}) with the hermetic
llvm toolchain, following the approach used by
https://github.com/hermeticbuild/codesign.bzl: a prebuilts.yaml
workflow builds //prebuilt:for_all_platforms on prebuilts-v* tags and
publishes the binaries as GitHub release artifacts referenced from
host/private/prebuilts.bzl. Building //prebuilt:detect_cpu for
windows-arm64 requires a patch for cpu_features that has been submitted
upstream as google/cpu_features#467.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
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.
src/impl_aarch64_windows.cincludes"internal/windows_utils.h", but the header is only listed in thehdrsof:cpuinfo(and:cpuinfo_for_testing) in the x86 branch of theselect. As a result, Bazel builds of:cpuinfofor windows-arm64 fail with:This adds the header to the ARM64 branch of both targets.