Skip to content

Test fixes and intermittent Linux failures #24

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

Merged
merged 6 commits into from
May 14, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .swift-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
main-snapshot-2025-04-12
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really don't understand the purpose of .swift-version... it doesn't really make sense for things that aren't a product (like libraries) and are expected to work across many different Swift versions.

And if we're fixing the compile error right now, what's the value in pinning to a snapshot anyways?

Copy link
Member Author

@cmcgee1024 cmcgee1024 Apr 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just trying to build and generate the documentation for this project and I couldn't get it to work on Linux reliably with the usual 6.1 toolchain. It might have been a weird bug I was encountering though so I can change this back to 6.1.0 for other developers working with this project.

The swift version file helps with development environments, and CI if it's configured to get everyone on a known good toolchain for developing the project.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With #23 this builds successfully for me on Linux with Swift 6.1, although runLinter() hangs and testSubprocessPlatfomOptionsPreSpawnProcessConfigurator() and testSuspendResumeProcess() fail. Is that what you're seeing as well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, also testSubprocessPlatformOptionsUserID is failing with an EACCES errno intermittently.

4 changes: 4 additions & 0 deletions Sources/Subprocess/Configuration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,11 @@ internal struct CreatedPipe {
}

internal init(closeWhenDone: Bool) throws {
#if os(Windows)
let pipe = try FileDescriptor.ssp_pipe()
#else
let pipe = try FileDescriptor.pipe()
#endif

self.readFileDescriptor = .init(
pipe.readEnd,
Expand Down
2 changes: 1 addition & 1 deletion Tests/SubprocessTests/SubprocessTests+Unix.swift
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ extension SubprocessUnixTests {
var platformOptions = PlatformOptions()
platformOptions.supplementaryGroups = Array(expectedGroups)
let idResult = try await Subprocess.run(
.name("/usr/bin/swift"),
.name("swift"),
arguments: [getgroupsSwift.string],
platformOptions: platformOptions,
output: .string
Expand Down