-
Notifications
You must be signed in to change notification settings - Fork 103
Add speculative support for OpenBSD. #890
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
Conversation
OpenBSD has partial support in the Swift toolchain. This PR adds speculative support for it based on the assumption that what works with FreeBSD will generally also work with OpenBSD. The big differences: 1. We need to include `<util.h>` instead of `<libutil.h>`, 2. `/usr/bin/tar` does not support writing PKZIP files (so we look for the optional `/usr/bin/zip` instead), and 3. OpenBSD has no way to determine the path to the current executable, so we naïvely assume `argv[0]` is correct. Partially resolves #888.
@swift-ci test |
@swift-ci test |
For (2) I know at least for FreeBSD there’s no /usr/bin/zip, I’m not sure about OpenBSD For (3) I think we get get it via sysctl Edit(3): found it https://github.com/swiftlang/swift-corelibs-foundation/blob/25d044f2c4ceb635d9f714f588673fd7a29790c1/Sources/CoreFoundation/CFPlatform.c#L224 |
Yeah that's just |
Fortunately, for FreeBSD we can and do just use libarchive via /usr/bin/tar. On OpenBSD, from what I can gather /usr/bin/zip exists as an optional package, but is not installed by default. |
re: zip, I think for installed packages, it should be in |
If I could get a VM set up, I'd check! |
Zip is in an optional package; these binaries go in /usr/local.
|
Other than the zip path, the changes look reasonable; I haven't been able to locally test fully due to the fact that bootstrapping a fully-featured toolchain is incomplete (see swiftlang/swift#78437), but I can revisit once I have a proper toolchain. |
If you want to give the PR a ✅, we can merge it (with the path fix, of course.) Or if you'd prefer to wait until you have an otherwise-functional toolchain, I can close this PR for now. |
@swift-ci test |
I'm happy if you merge sooner rather than later, and we take care of any missing pieces then. |
Sounds good to me. Will chat with my colleagues today about it, should be able to merge before EOD. |
OpenBSD has partial support in the Swift toolchain. This PR adds speculative support for it based on the assumption that what works with FreeBSD will generally also work with OpenBSD. The big differences:
<util.h>
instead of<libutil.h>
,/usr/bin/tar
does not support writing PKZIP files (so we look for the optional/usr/bin/zip
instead), andargv[0]
is correct.These changes are speculative and have not been tested.
Partially resolves #888.
Checklist: