Skip to content

Add support for OpenBSD #888

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

Closed
3 tasks
grynspan opened this issue Jan 4, 2025 · 4 comments · Fixed by #890
Closed
3 tasks

Add support for OpenBSD #888

grynspan opened this issue Jan 4, 2025 · 4 comments · Fixed by #890
Labels
enhancement New feature or request help wanted Extra attention is needed openbsd 🐡 OpenBSD support

Comments

@grynspan
Copy link
Contributor

grynspan commented Jan 4, 2025

Add support for OpenBSD:

  • Audit our platform-specific code and add branches for OpenBSD (mostly, but not entirely, the same as FreeBSD)
  • Set up team workstations or VMs
  • Set up CI jobs
@grynspan grynspan added enhancement New feature or request help wanted Extra attention is needed openbsd 🐡 OpenBSD support labels Jan 4, 2025
@grynspan
Copy link
Contributor Author

grynspan commented Jan 4, 2025

As far as I know, the FreeBSD code should all work verbatim except for CommandLine.executablePath.

@grynspan
Copy link
Contributor Author

grynspan commented Jan 4, 2025

zip and/or tar support needs checking too.

@grynspan
Copy link
Contributor Author

grynspan commented Jan 4, 2025

#define	RTLD_DEFAULT	((void *) -2)	/* Use default search algorithm. */

grynspan added a commit that referenced this issue Jan 4, 2025
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.
grynspan added a commit that referenced this issue Jan 6, 2025
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.

These changes are speculative and have not been tested.

Partially resolves #888.

### Checklist:

- [x] Code and documentation should follow the style of the [Style
Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md).
- [x] If public symbols are renamed or modified, DocC references should
be updated.
@grynspan
Copy link
Contributor Author

Tracked internally as rdar://142344821.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed openbsd 🐡 OpenBSD support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant