Skip to content

Add a Pipe type. #694

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 4 commits into from
Sep 16, 2024
Merged

Add a Pipe type. #694

merged 4 commits into from
Sep 16, 2024

Conversation

grynspan
Copy link
Contributor

@grynspan grynspan commented Sep 16, 2024

This PR adds a move-only wrapper for POSIX and Windows anonymous pipes (i.e. those created with pipe(2).) We will need pipes in order to implement platform-independent interprocess communication such as that required by exit tests or future adoption of distributed actors.

Checklist:

  • Code and documentation should follow the style of the Style Guide.
  • If public symbols are renamed or modified, DocC references should be updated.

This PR adds a move-only wrapper for POSIX and Windows anonymous pipes (i.e.
those created with `pipe(2)`.) We will need pipes in order to implement
platform-independent interprocess communication such as that required by exit
tests or future adoption of distributed actors.
@grynspan grynspan added enhancement New feature or request exit-tests ☠️ Work related to exit tests labels Sep 16, 2024
@grynspan grynspan added this to the Swift 6.1 milestone Sep 16, 2024
@grynspan grynspan self-assigned this Sep 16, 2024
@grynspan
Copy link
Contributor Author

@swift-ci test

@grynspan
Copy link
Contributor Author

@swift-ci test

@grynspan
Copy link
Contributor Author

@swift-ci test

@grynspan
Copy link
Contributor Author

@swift-ci test Windows

@grynspan
Copy link
Contributor Author

@swift-ci test

@grynspan
Copy link
Contributor Author

@swift-ci test Linux

@grynspan
Copy link
Contributor Author

@swift-ci test macOS

@grynspan grynspan merged commit 265a7ed into main Sep 16, 2024
3 checks passed
@grynspan grynspan deleted the jgrynspan/add-pipe-type branch September 16, 2024 21:36
@kateinoigakukun
Copy link
Member

Unfortunately, WASI doesn't have pipe...

/home/build-user/swift-testing/Sources/Testing/Support/FileHandle.swift:449:20: error: cannot find 'pipe' in scope
447 |         }
448 | #else
449 |         guard 0 == pipe(fds.baseAddress) else {
    |                    `- error: cannot find 'pipe' in scope
450 |           throw CError(rawValue: swt_errno())
451 |         }

@grynspan
Copy link
Contributor Author

We can add a SWT_NO_PIPE flag for this. I'll open a PR in the morning (my time.) Would you mind filing an issue?

@kateinoigakukun
Copy link
Member

@grynspan Thanks! Opened an issue here 🙏 #698

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request exit-tests ☠️ Work related to exit tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants