tests: Fix module loading prefer-serialized test failure on Windows #65955
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.
Fixes three tests failing on Windows:
These test cases remove read access to the
.swiftmodule
. The expected behavior is that the compiler checksfs.exists("path-to.swiftmodule")
, determines that the file exists and chooses to use it instead of the.swiftinterface
. Compilation then fails because the file cannot be read.https://github.com/apple/swift/blob/e22cf2e993267639ad8875707cadf401eb97d98b/lib/Frontend/ModuleInterfaceLoader.cpp#L752
On Windows, we were denying
R
access, which is broader than only read access to file contents but also includes file attributes and permissions. This causedfs.exists
to fail since it relies onfs.status
, which could not open the file withCreateFileW
. The fix is is to only denyRD - read data/list directory
access.Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.
Resolves #NNNNN, fix apple/llvm-project#MMMMM.