Skip to content
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

Allow non-blocking file locks #458

Merged
merged 1 commit into from
Jan 22, 2024

Conversation

neonichu
Copy link
Contributor

No description provided.

@neonichu
Copy link
Contributor Author

@neonichu
Copy link
Contributor Author

TSCBasicTests/FileSystemTests.swift:883: Fatal error: 'try!' expression unexpectedly raised an error: TSCBasic.FileSystemError(kind: TSCBasic.FileSystemError.Kind.unsupported, path: Optional(<AbsolutePath:"/tmp/TemporaryDirectory.bGFJkn/lockfile">))

Probably did something wrong in the InMemoryFileSystem implementation of non-blocking, this was only supposed to be thrown if we ask for a non-blocking lock which nothing should do.

@neonichu
Copy link
Contributor Author

neonichu commented Jan 19, 2024

Ah no, the issue is that I didn't fully adopt InMemoryFileSystem correctly.

There seems to be something weird going on with the protocol extension and default arguments such that we call the function from the protocol extension (which throws unimplemented) rather than the one from the concrete implementation.

@neonichu
Copy link
Contributor Author

@neonichu
Copy link
Contributor Author

Changed this now such that we don't use default arguments anymore and that seems to resolve the issue.

@neonichu
Copy link
Contributor Author

swiftlang/swift-package-manager#7269
@swift-ci please test windows

@neonichu
Copy link
Contributor Author

@neonichu
Copy link
Contributor Author

swiftlang/swift-package-manager#7269
@swift-ci please test windows

@neonichu
Copy link
Contributor Author

neonichu commented Jan 19, 2024

2024-01-19 20:12:14.895.Test Suite 'FileSystemTests' started at 2024-01-19 20:12:14.895.
Test Case '-[TSCBasicTests.FileSystemTests testLocalReadWriteFile]' started./Users/ec2-user/jenkins/workspace/pr-swift-tools-support-core-macos/branch-main/swift-tools-support-core/Tests/TSCBasicTests/FileSystemTests.swift:334: error: -[TSCBasicTests.FileSystemTests testLocalReadWriteFile] : XCTAssertEqual failed: ("FileSystemError(kind: TSCBasic.FileSystemError.Kind.ioError(code: 17), path: Optional(<AbsolutePath:"/">))") is not equal to ("FileSystemError(kind: TSCBasic.FileSystemError.Kind.isDirectory, path: Optional(<AbsolutePath:"/">))")Test Case '-[TSCBasicTests.FileSystemTests testLocalReadWriteFile]' failed (0.375 seconds).Test Suite 'FileSystemTests' failed at 2024-01-19 20:12:15.270.

Not sure what this is...

@neonichu
Copy link
Contributor Author

OK, issue is present in baseline as well (https://ci.swift.org/job/pr-swift-tools-support-core-macos/359/) and I also have been seeing it locally for a while. Probably a slight behavior change between macOS versions?

@neonichu
Copy link
Contributor Author

Fixing the test in #460

@MaxDesiatov
Copy link
Contributor

@neonichu neonichu merged commit 6ba70be into swiftlang:main Jan 22, 2024
3 checks passed
@neonichu neonichu deleted the allow-non-blocking-flock branch January 22, 2024 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants