[ET][Windows] Fix ExecuTorch Windows host build portability defects#20948
Merged
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/20948
Note: Links to docs will display an error until the docs builds have been completed. ❌ 34 New FailuresAs of commit c061549 with merge base ceecc9e ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
Gasoonjia
approved these changes
Jul 14, 2026
meta-codesync
Bot
merged commit Jul 16, 2026
66f08a3
into
gh/SS-JIA/573/base
169 of 215 checks passed
SS-JIA
added a commit
that referenced
this pull request
Jul 16, 2026
Pull Request resolved: #20948 Building ExecuTorch (Vulkan backend plus core runtime) for a Windows x86_64 host with the arvr clang toolchain surfaced three genuine portability defects that fail under its strict `-Werror` set and generated-header wiring. These are correct fixes independent of any warning-suppression workaround. In `runtime/core/portable_type/c10/c10/targets.bzl`, the arvr-mode `select` that supplies the generated `ATen/Config.h` routed every non-Android OS to `ovrsource_aten_Config.h`, an OVR-native-only `oxx_static_library` that produces no output on the Windows host. The result was `fatal error: 'ATen/Config.h' file not found` in every CPU kernel that includes ATen vec headers. This adds an `ovr_config//os:windows` branch pointing at the working `generated_aten_config_header`, mirroring the existing Android fallback. In `backends/vulkan/runtime/api/containers/Tensor.h`, `size()` and `dim()` returned `const int64_t` by value; the meaningless top-level `const` on a scalar return trips `-Werror,-Wignored-qualifiers`. This header is included throughout the Vulkan backend, so it blocked `vulkan_graph_runtime`. The `const` qualifier is dropped. In `extension/data_loader/mman.h` and `mman_windows.cpp`, `#define NOMINMAX` was unconditional while the toolchain already predefines it, tripping `-Werror,-Wmacro-redefined` when compiling `mmap_data_loader` (pulled in by `Module`). Both sites are now guarded with `#ifndef NOMINMAX`. ghstack-source-id: 402995448 @exported-using-ghexport Differential Revision: [D112012051](https://our.internmc.facebook.com/intern/diff/D112012051/)
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.
Stack from ghstack (oldest at bottom):
Building ExecuTorch (Vulkan backend plus core runtime) for a Windows x86_64 host with the arvr clang toolchain surfaced three genuine portability defects that fail under its strict
-Werrorset and generated-header wiring. These are correct fixes independent of any warning-suppression workaround.In
runtime/core/portable_type/c10/c10/targets.bzl, the arvr-modeselectthat supplies the generatedATen/Config.hrouted every non-Android OS toovrsource_aten_Config.h, an OVR-native-onlyoxx_static_librarythat produces no output on the Windows host. The result wasfatal error: 'ATen/Config.h' file not foundin every CPU kernel that includes ATen vec headers. This adds anovr_config//os:windowsbranch pointing at the workinggenerated_aten_config_header, mirroring the existing Android fallback.In
backends/vulkan/runtime/api/containers/Tensor.h,size()anddim()returnedconst int64_tby value; the meaningless top-levelconston a scalar return trips-Werror,-Wignored-qualifiers. This header is included throughout the Vulkan backend, so it blockedvulkan_graph_runtime. Theconstqualifier is dropped.In
extension/data_loader/mman.handmman_windows.cpp,#define NOMINMAXwas unconditional while the toolchain already predefines it, tripping-Werror,-Wmacro-redefinedwhen compilingmmap_data_loader(pulled in byModule). Both sites are now guarded with#ifndef NOMINMAX.Differential Revision: D112012051