Skip to content

Commit 1b0a937

Browse files
committed
Create 'security' directory test should try writing files too (#3941)
Motivation: Source compat test continues to fail even with #3928: ``` "You don’t have permission to save the file “fingerprints” in the folder “security” ``` https://ci.swift.org/job/swift-PR-source-compat-suite/5709/artifact/ The tests we did with #3938 shows that we can create directories but not write files. Modifications: Test creating `security` directory and writing file in it, and disable TOFU feature if the test fails.
1 parent b64b34a commit 1b0a937

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Sources/Commands/SwiftTool.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,8 @@ public class SwiftTool {
648648
if !fileSystem.exists(sharedSecurityDirectory) {
649649
try fileSystem.createDirectory(sharedSecurityDirectory, recursive: true)
650650
}
651+
// And make sure we can write files (locking the directory writes a lock file)
652+
try fileSystem.withLock(on: sharedSecurityDirectory, type: .exclusive) { }
651653
return sharedSecurityDirectory
652654
} catch {
653655
self.observabilityScope.emit(warning: "Failed creating shared security directory: \(error)")

0 commit comments

Comments
 (0)