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
Prefer "#if os(Linux)" to "#if !os(macOS) #1826
Conversation
This has been annoying me too for some time, but I haven’t gotten around to submitting a fix myself. In this specific case (the generated test manifests), I think |
@SDGGiesbrecht Good idea, thanks! |
Thanks! Can you also run |
@aciidb0mb3r What are the steps to getting there? I've built spm per the docs and there's no
|
How did you build swiftpm? Don't run |
I followed the directions pointed to here: https://github.com/apple/swift-package-manager/blob/master/Documentation/Development.md Basically, ran |
Ah. That puts the build directory next to your checkout of SwiftPM. However, I would recommend following the second method unless you really require a compiler built from scratch: https://github.com/apple/swift-package-manager/blob/master/Documentation/Development.md#using-trunk-snapshot |
Done! Probably would have been faster to manually update :) Took awhile to attempt to build with |
To avoid making things harder for non-Linux porters, I’ve been slowly transitioning Foundation to |
Should I change to |
I should update the dev docs. Given the source compatibility, compiling from scratch is rarely required. |
I agree, ObjectiveC check seems more appropriate but Darwin should also work. Let me see if I can quickly check with someone from the Swift team. |
I haven't heard back yet. Lets get this in, I'll update the code if I hear back about a preferred way. |
@swift-ci smoke test |
Failure seems related, I'll update the patch. |
Currently, projects that use `--generate-linuxmain` will generate a file that breaks iOS and other platforms.
@swift-ci smoke test |
Clean up a few general patterns that are now obviated by canImport This aligns more generally with the cleanup that the Swift Package Manager has already done in their automated XCTest-plumbing tool in apple/swift-package-manager#1826.
Currently, projects that use
--generate-linuxmain
will generate a file that breaks iOS and other platforms.There may be more things that need to be fixed here, but this is a start. I noticed that throughout this project things are cased on
os(macOS)
a lot. Perhaps an audit is a good idea?