Commit Graph

3 Commits

Author SHA1 Message Date
Tristan Labelle
d0ba4ced4b tests: Fix module loading prefer-serialized test failure on Windows
Fixes three tests failing on Windows:

```
  Swift(windows-x86_64) :: ModuleInterface/ModuleCache/force-module-loading-mode-archs.swift
  Swift(windows-x86_64) :: ModuleInterface/ModuleCache/force-module-loading-mode-framework.swift
  Swift(windows-x86_64) :: ModuleInterface/ModuleCache/force-module-loading-mode.swift
```

These test cases remove read access to the `.swiftmodule` . The expected
behavior is that the compiler checks `fs.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.

e22cf2e993/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 caused `fs.exists` to fail since it relies on
`fs.status`, which could not open the file with `CreateFileW`. The fix
is is to only deny `RD - read data/list directory` access.
2023-05-16 14:56:40 -07:00
Saleem Abdulrasool
240ae1b589 test: make make-unreadable Python 3 friendly
Make `make-unreadable` python 3 compatible.  `POINTER` is now in
`ctypes` rather than in `ctypes.wintypes`.  Use the new location which
is compatible across python 2 and python 3.
2020-06-24 09:00:21 -07:00
Harlan Haskins
d3b8ce7ae2 [test] Update ParseableInterface to ModuleInterface
Also remove uses of -emit-parseable-module-interface from tests
2019-09-13 14:55:48 -07:00