Skip to content

[Asynchronous] Move into separate directory #172

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

Conversation

modocache
Copy link
Contributor

Three changes:

  1. Move files related to XCTestCase+Asynchronous into a separate directory.
  2. Move methods on XCTestCase that vend expectations for Predicate and Notification into their own files.
  3. Modify the build script in order to traverse deeply nested files.

Besides general project hygiene, the motivation for this change is, unintuitively, related to libdispatch: import Dispatch within XCTestCase+Asynchronous would otherwise result in an error indicating that NSObjectProtocol (used within the expectation(forNotification:...) method) is an ambiguous reference. By keeping the source files small and limiting the scope in which Dispatch is imported, we can sidestep the error.

@modocache
Copy link
Contributor Author

modocache commented Sep 21, 2016

I haven't tested this on Linux, so I'd be surprised if it worked on the first try. Here goes nothing! 😅

@modocache
Copy link
Contributor Author

@swift-ci please test

@modocache
Copy link
Contributor Author

Somehow I doubt this change would've caused a error in LLVM IR debug info 😂 I'll try kicking CI again tomorrow.

@modocache
Copy link
Contributor Author

@swift-ci please test

@briancroom
Copy link
Contributor

Cool, I like these changes, although the ambiguous reference issue with libdispatch does seem like a bug that should be addressed at some point. Do you know if there is a Jira issue on that?

Also from the CI log it looks like you've uncovered a compiler crasher, unless perhaps some stale build products are somehow interfering. Let's give it another try.

@briancroom
Copy link
Contributor

@swift-ci please test

@modocache
Copy link
Contributor Author

Ooh, neat. Later today I'll file a bug for both the crasher in CI and for the ambiguous reference I described above, then try to work around the issue here.

Three changes:

1. Move files related to `XCTestCase+Asynchronous` into a separate directory.
2. Move methods on `XCTestCase` that vend expectations for `Predicate` and
   `Notification` into their own files.
3. Modify the build script in order to traverse deeply nested files.

Besides general project hygiene, the motivation for this change is,
unintuitively, related to libdispatch: `import Dispatch` within
`XCTestCase+Asynchronous` would otherwise result in an error indicating
that `NSObjectProtocol` (used within the `expectation(forNotification:...)`
method) is an ambiguous reference. By keeping the source files small
and limiting the scope in which `Dispatch` is imported, we can sidestep
the error.
@modocache modocache force-pushed the async-fixme-runloop-source-project-reorg branch from 8ed4d7e to ac97606 Compare September 23, 2016 00:21
@modocache
Copy link
Contributor Author

modocache commented Sep 23, 2016

Sure enough, the glob pattern I added for Linux didn't work. The updated pull request has one that does, so all the source files are included in the compilation.

@modocache
Copy link
Contributor Author

@swift-ci please test

@modocache
Copy link
Contributor Author

An error in swift-corelibs-foundation NSFileManager caused the macOS build to fail. Considering it passed before, and the only changes I've made since only affect Linux, I'd be fine merging this. I'll leave it to you though, @briancroom!

@modocache
Copy link
Contributor Author

@swift-ci please test

@briancroom
Copy link
Contributor

@swift-ci please test

@briancroom
Copy link
Contributor

Nice job tracking that issue down. Let's get this merged, and hopefully get some positive feedback on swiftlang/swift-corelibs-foundation#656 now that that one has gone in as well!

Thanks @modocache.

@briancroom briancroom merged commit 7d61248 into swiftlang:master Sep 26, 2016
@modocache modocache deleted the async-fixme-runloop-source-project-reorg branch September 26, 2016 18:43
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.

2 participants