Skip to content

OpenBSD support #228

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 2 commits into from
Jun 28, 2021
Merged

OpenBSD support #228

merged 2 commits into from
Jun 28, 2021

Conversation

3405691582
Copy link
Member

Preliminary OpenBSD support. Some particular notes:

  • Of note is the changes to FSWatch. inotify is only available on Linux,
    so do not condition on canImport(Glibc) but restrict to operating
    systems using the Linux kernel only.

    Naturally, OpenBSD does not have FSEventStream either, so for now,
    create a no-op delegate for this platform. It is possible that this
    particular functionality might be provided by some creative use of
    kevent, but we defer that here: such behavior would be important for
    platforms that do not have support for monitoring filesystem events.

  • On this platform, SQLite resides in /usr/local/lib, so make the
    necessary cmake changes as well, while we are here.

  • We do still need to do something about the unversionedTriple
    inference: this will be handled separately.

  • Flatten TIOCGWINSZ on OpenBSD.

    On this platform, the TIOCGWINSZ ioctl identifier is a complex macro.
    Compare TSCUtility: deprecate dl* #291 in swift-argument-parser.

On this platform, the TIOCGWINSZ ioctl identifier is a complex macro.
Since we don't have a C bridging header obviously available to get the
flattened value, supply is the flattened value obtained elsewhere. This
is of course brittle but this is the simplest way around this for now.

Compare swiftlang#291 in swift-argument-parser.
@neonichu
Copy link
Contributor

@swift-ci please test

@tomerd
Copy link
Contributor

tomerd commented Jun 22, 2021

cc @drexin

Copy link
Contributor

@tomerd tomerd left a comment

Choose a reason for hiding this comment

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

cool stuff, added a couple of questions / suggestions

@neonichu
Copy link
Contributor

@swift-ci please test

@tomerd
Copy link
Contributor

tomerd commented Jun 23, 2021

lgtm, pending @drexin input

@tomerd
Copy link
Contributor

tomerd commented Jun 23, 2021

@3405691582 we would need a corresponding PR into SwiftPM itself given that this introduces a new enum case that is not handled there in some cases. cc @neonichu

@drexin
Copy link
Contributor

drexin commented Jun 23, 2021

@swift-ci test

@3405691582
Copy link
Member Author

@tomerd created SPM pull 3572 for platform support, which should cover the additional cases.

@tomerd
Copy link
Contributor

tomerd commented Jun 23, 2021

@tomerd created SPM pull 3572 for platform support, which should cover the additional cases.

cool @neonichu can you remind me how to test this PR cross the two repos?

@neonichu
Copy link
Contributor

@tomerd
Copy link
Contributor

tomerd commented Jun 23, 2021

@3405691582 looks like there is some syntax issue?

@3405691582
Copy link
Member Author

3405691582 commented Jun 23, 2021

Oops! Sorry about that. Fixed.

@tomerd
Copy link
Contributor

tomerd commented Jun 23, 2021

@tomerd
Copy link
Contributor

tomerd commented Jun 25, 2021

@neonichu do you know why the cross-PR test is not working, or are those real issues with the changes?

Copy link
Member

@finagolfin finagolfin left a comment

Choose a reason for hiding this comment

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

Looks good, only one nit about Android change.

@3405691582
Copy link
Member Author

@buttaface So as not to contradict other review guidance about this, would you mind if I made that change for Android in another pr?

@finagolfin
Copy link
Member

It's okay, you can make it here. Dario was likely just trying to not break things for me, and I'm telling you I tested building it, so please go ahead here. It's just three lines to remove, no big deal.

Of note is the changes to FSWatch. inotify is only available on Linux,
so do not condition on `canImport(Glibc)` but restrict to operating
systems using the Linux kernel only.

Naturally, OpenBSD does not have FSEventStream either, so for now,
create a no-op delegate for this platform. It is possible that this
particular functionality might be provided by some creative use of
kevent, but we defer that here: such behavior would be important for
platforms that do not have support for monitoring filesystem events.

On this platform, SQLite resides in /usr/local/lib, so make the
necessary cmake changes as well, while we are here.

We do still need to do something about the `unversionedTriple`
inference: this will be handled separately.
@3405691582
Copy link
Member Author

SGTM. Done.

@tomerd
Copy link
Contributor

tomerd commented Jun 25, 2021

@neonichu
Copy link
Contributor

swiftlang/swift-package-manager#3572
@swift-ci please test linux

@neonichu neonichu merged commit a7f0a5e into swiftlang:main Jun 28, 2021
compnerd added a commit to compnerd/swift-tools-support-core that referenced this pull request Jun 30, 2021
compnerd added a commit that referenced this pull request Jun 30, 2021
TSCUtility: repair the windows build after #228
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.

5 participants