Skip to content

Make POSIXError use POSIXErrorCode from Swift Stdlib #933

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
wants to merge 2 commits into from

Conversation

colemancda
Copy link
Contributor

Right now POSIXError is broken on Linux, with Foundation defining POSIXError.Code that is valid for Darwin, not Linux. The Swift Standard Library already has a properly defined and unit tested POSIXErrorCode that is platform specific for Darwin and Linux. Foundation should use this enum and not define an invalid duplicate.

@CodaFi
Copy link
Contributor

CodaFi commented Apr 6, 2017

Nit: Can you rebase to squash the merge commits?

@colemancda
Copy link
Contributor Author

@CodaFi Done.

@CodaFi
Copy link
Contributor

CodaFi commented Apr 6, 2017

@swift-ci test

Happening here

@pushkarnk
Copy link
Member

Looks good, but the tests didn't run. Let me try:

@swift-ci please test

@pushkarnk
Copy link
Member

@swift-ci please test

@pushkarnk
Copy link
Member

Foundation/NSError.swift:881:11: error: use of undeclared type 'POSIXErrorCode'
extension POSIXErrorCode: _ErrorCodeProtocol {

@colemancda
Copy link
Contributor Author

POSIXErrorCode is defined in the standard library and is available on Darwin and Linux. Why is this code not compiling?

@CodaFi
Copy link
Contributor

CodaFi commented Apr 7, 2017

POSIXErrorCode is part of the platform libraries, not Swift. You need to import Glibc on Linux and Darwin on macOS to use it.

@@ -10,6 +10,11 @@
//
//===----------------------------------------------------------------------===//

#if os(OSX) || os(iOS)
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: macOS

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Rebased and changed

Darwin or Glibc

Make `POSIXError` use POSIXErrorCode from platform library
@CodaFi
Copy link
Contributor

CodaFi commented Apr 7, 2017

@swift-ci please test

2 similar comments
@parkera
Copy link
Contributor

parkera commented Apr 14, 2017

@swift-ci please test

@alblue
Copy link
Contributor

alblue commented Jun 1, 2017

@swift-ci please test

@alblue
Copy link
Contributor

alblue commented Oct 5, 2017

@colemancda Can you rebase this and try again?

@alblue
Copy link
Contributor

alblue commented Oct 16, 2017

This pull request has gone stale, and the build fails. If the build can be fixed and rebased onto master, then it can be re-submitted.

@alblue alblue closed this Oct 16, 2017
@colemancda
Copy link
Contributor Author

Fixed in swiftlang/swift@8157194

@colemancda
Copy link
Contributor Author

Rework in #2113

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.

6 participants