-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DO NOT MERGE] Test creating 'fingerprints' dir #3938
Conversation
Looks like we can create directories but cannot write files. New error:
https://ci.swift.org/job/swift-PR-source-compat-suite/5710/artifact/swift-source-compat-suite/ |
Motivation: Source compat test continues to fail even with swiftlang#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/ Not sure how/why, but it seems like `security` directory is created just fine but not the `fingerprints` sub directory (`fingerprints` is a directory not a file, and the code add a file to the `fingerprints` dir for each downloaded package). Modifications: Test creating `fingerprints` directory instead of `security`, and if that fails, disable TOFU feature.
1dac71f
to
087800e
Compare
@swift-ci please smoke test |
https://ci.swift.org/job/swift-PR-source-compat-suite/5713/ passes (087800e), which confirms we can create directories but not files. |
I think we need @shahmishal to help understand how that sandbox is set up |
Motivation: Source compat test continues to fail even with swiftlang#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 swiftlang#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.
Replaced by #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.
…ang#3941) Motivation: Source compat test continues to fail even with swiftlang#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 swiftlang#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.
* Disable fingerprint checking when storage is not available Motivation: Source compat test failure: https://ci.swift.org/job/swift-PR-source-compat-suite/5701/artifact/swift-source-compat-suite/ ``` error: Failed to get source control fingerprint for swift-log remoteSourceControl https://github.com/apple/swift-log.git version 1.4.2 from storage: Error Domain=NSCocoaErrorDomain Code=513 "You don't have permission to save the file "fingerprints" in the folder "security"." UserInfo={NSFilePath=/Users/buildnode/.swiftpm/security/fingerprints, NSUnderlyingError=0x7feaae439370 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}} error: Error Domain=NSCocoaErrorDomain Code=513 "You don't have permission to save the file "fingerprints" in the folder "security"." UserInfo={NSFilePath=/Users/buildnode/.swiftpm/security/fingerprints, NSUnderlyingError=0x7feaae439370 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}} ``` Modifications: - Make `PackageFingerprintStorage` optional in `RegistryClient` and `SourceControlPackageContainer`, which would turn off fingerprint read/write and essentially disable the TOFU feature. - `SwiftTool` will try to create the shared security directory (under which fingerprints are stored), and if it fails (e.g., permission errors) set `PackageFingerprintStorage` to none. - Don't perform integrity check on fingerprint write. The validation failure will happen on read. * Throw fingerprint write errors Per review feedback, reverting part of the changes introduced in #3928. * 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. * Fix test that fails to compile (#3936) Co-authored-by: Doug Gregor <dgregor@apple.com>
Motivation:
Source compat test continues to fail even with #3928:
https://ci.swift.org/job/swift-PR-source-compat-suite/5709/artifact/
Not sure how/why, but it seems like
security
directory is created just fine but not thefingerprints
sub directory (fingerprints
is a directory not a file, and the code add a file to thefingerprints
dir for each downloaded package).Modifications:
Test creating
fingerprints
directory instead ofsecurity
, and if that fails, disable TOFU feature.