Fix Windows Build: Add /Zc:preprocessor, Pin Python 3.12, Fix constinit#6238
Open
SriHarsha-23 wants to merge 2 commits intogoogle-ai-edge:masterfrom
Open
Fix Windows Build: Add /Zc:preprocessor, Pin Python 3.12, Fix constinit#6238SriHarsha-23 wants to merge 2 commits intogoogle-ai-edge:masterfrom
SriHarsha-23 wants to merge 2 commits intogoogle-ai-edge:masterfrom
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
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.
This PR fixes the default build on Windows (MSVC 2022 + Bazel 9), addressing multiple compile-time errors.
Issues Fixed
Python 3.13 Compatibility:
Could not find requirements_lock.txt file matching specified Python version: 3.13build:windows --repo_env=HERMETIC_PYTHON_VERSION=3.12to.bazelrc. This forces the build to use a supported Python version, preventing crashes on systems where Python 3.13 is the default.MSVC Preprocessor Error:
MP_STATUS_MACROS_IMPL_REM: undeclared identifierbuild:windows --copt=/Zc:preprocessorto.bazelrc. The MSVC legacy preprocessor fails to expand MediaPipe's status macros correctly. Enabling the standard-conforming preprocessor fixes this.constinit Mismatch:
C2475: 'mediapipe::kGpuService': redefinition; 'constinit' specifier mismatchconstinittokGpuServicein bothmediapipe/gpu/gpu_service.handmediapipe/gpu/gpu_service.ccto ensure the declaration and definition match, satisfying the MSVC compiler strictness.Verification
Verified by successfully building and running the
hello_worldexample on Windows 11 with Visual Studio 2022.Closes #5748
Closes #6176