Skip to content

Sema/SIL: NSError has no special powers without ObjC interop. #7761

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 1 commit into from
Feb 25, 2017

Conversation

jckarter
Copy link
Contributor

In particular, it doesn't "toll-free bridge" to the Error existential on non-ObjC-interop platforms, and we would miscompile as if it could. This should fix SR-585.

@jckarter
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - 69f322255e47d7885ec2efd4517ee28c48334e64
Test requested by - @jckarter

@jckarter jckarter force-pushed the nserror-linux-bridging branch from 69f3222 to 43a559e Compare February 25, 2017 03:21
@jckarter
Copy link
Contributor Author

@swift-ci Please test Linux

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - 43a559e9aafe1405e85b33e37e2cabe3f3c10aa4
Test requested by - @jckarter

@jckarter jckarter force-pushed the nserror-linux-bridging branch from 43a559e to 7f2b778 Compare February 25, 2017 03:48
@jckarter
Copy link
Contributor Author

@swift-ci Please test Linux

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - 7f2b77892d0c61000661587b82365d499ee3d9c1
Test requested by - @jckarter

@jckarter jckarter force-pushed the nserror-linux-bridging branch 2 times, most recently from 707ea16 to eb8e7bc Compare February 25, 2017 04:09
@jckarter
Copy link
Contributor Author

@swift-ci Please test Linux

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - eb8e7bc3092a8eec9c97ec8a0fae78c5b4a98d40
Test requested by - @jckarter

@jckarter jckarter force-pushed the nserror-linux-bridging branch from eb8e7bc to e7fde81 Compare February 25, 2017 05:12
@jckarter
Copy link
Contributor Author

@swift-ci Please test Linux

@lupinglade
Copy link

Thank you! This is a huge fix in terms of usability of Swift on Linux!

@jckarter
Copy link
Contributor Author

@lupinglade I have to ask, why do you need NSError on Linux in the first place?

@jckarter
Copy link
Contributor Author

@swift-ci Please test OS X

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - 69f322255e47d7885ec2efd4517ee28c48334e64
Test requested by - @jckarter

@lupinglade
Copy link

lupinglade commented Feb 25, 2017

@jckarter We're catching NSErrors thrown by corelibs-foundation. I think this is a common use case. We're also throwing our own errors using NSError currently just for consistency, though we can change that - but we can't change the fact that Foundation is using them, right?

@gwynne
Copy link
Contributor

gwynne commented Feb 25, 2017

I can confirm this fixed the crash for me. As for fixing Foundation not to throw NSError on Linux, I may be able to find time this weekend to do that pull request myself... I hope so anyhow.

@jckarter
Copy link
Contributor Author

@swift-ci Please test OS X

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - e7fde8123ebc786c83a68e66c77240cada1842f0
Test requested by - @jckarter

@jckarter
Copy link
Contributor Author

@swift-ci Please test OS X

In particular, it doesn't "toll-free bridge" to the Error existential on non-ObjC-interop platforms, and we would miscompile as if it could. This should fix SR-585.
@jckarter jckarter force-pushed the nserror-linux-bridging branch from e7fde81 to d998692 Compare February 25, 2017 17:20
@jckarter
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - d998692
Test requested by - @jckarter

@jckarter
Copy link
Contributor Author

@swift-ci Please test Linux

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - d998692
Test requested by - @jckarter

@jckarter
Copy link
Contributor Author

@shahmishal Looks like the Linux builders might be hitting resource limits on the validation test suite:

[ RUN      ] ThreadSafeCachingTests.ReturnGetExpression
terminate called after throwing an instance of 'std::system_error'
  what():  Resource temporarily unavailable

@jckarter jckarter merged commit a0c03d0 into swiftlang:master Feb 25, 2017
@lupinglade
Copy link

Can we get this into the swift 3.1 branch?

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.

4 participants