tests: support whl_from_dir_repo on Windows#3740
Merged
rickeylev merged 2 commits intobazel-contrib:mainfrom Apr 26, 2026
Merged
tests: support whl_from_dir_repo on Windows#3740rickeylev merged 2 commits intobazel-contrib:mainfrom
rickeylev merged 2 commits intobazel-contrib:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request enables several tests on Windows by removing the SUPPORTS_BZLMOD_UNIXY compatibility constraint and implementing Windows-specific support for the whl_from_dir_repo repository rule using a new PowerShell script. Feedback suggests improving resource management in the PowerShell script by using try...finally blocks for stream disposal and correcting a misleading comment regarding path handling in the repository rule.
ef21250 to
f8f0a90
Compare
The `whl_from_dir_repo` repository rule previously relied on the Unix `zip` utility to create wheels. Because this command isn't natively available on Windows, any tests that depended on repositories generated by this rule had to be explicitly skipped on Windows hosts. To fix this and expand our test coverage, this adds a native Windows fallback. When running on Windows, the rule now invokes a helper PowerShell script that uses .NET compression APIs to create the archive. This script ensures the resulting wheel remains uncompressed and uses zeroed-out timestamps to match the deterministic behavior of the original `zip -0X` command. With this constraint removed, the Unix-only compatibility flags (`SUPPORTS_BZLMOD_UNIXY`) have been dropped, enabling several namespace package and wheel-related integration tests to finally run on Windows.
f8f0a90 to
e7ca80d
Compare
aignas
approved these changes
Apr 26, 2026
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.
tests: support whl_from_dir_repo on Windows
The
whl_from_dir_reporepository rule previously relied on the Unixziputility to create wheels. Because this command isn't nativelyavailable on Windows, any tests that depended on repositories generated
by this rule had to be explicitly skipped on Windows hosts.
To fix this and expand our test coverage, this adds a native Windows
fallback. When running on Windows, the rule now invokes a helper
PowerShell script that uses .NET compression APIs to create the
archive. This script ensures the resulting wheel remains uncompressed
and uses zeroed-out timestamps to match the deterministic behavior of
the original
zip -0Xcommand.With this constraint removed, the Unix-only compatibility flags
(
SUPPORTS_BZLMOD_UNIXY) have been dropped, enabling several namespacepackage and wheel-related integration tests to finally run on Windows.