Skip to content

Further integration of Dispatch into Foundation #338

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
Apr 28, 2016

Conversation

seabaylea
Copy link
Contributor

This makes some minor changes that gets us closer to having Dispatch built and included in CoreFoundation and Foundation, including:

  • Switching CFRunLoop to use the new 4CF functions in libdispatch
    Note that these APIs are only available in the `experimental/foundation' branch of libdispatch.
  • Adding a basic implementation for pthread_main_np()
    There isn't an implementation in Glibc and there isn't a shim today. We should potentially move the implementation to the Glibc overlay.
  • Updated the build scripts to include Dispatch in Foundation as well as CoreFoundation
    This is still commented out as there's a number of compile errors in NSOperation and the incoming NSURLSession code - we should fix those up before uncommenting this code.

The changes should allow anyone to build a toolchain with Dispatch enabled by:

  1. Extracting the experimental/foundation branch of swift-corelibs-libdispatch
  2. Uncommenting the code in build.py
  3. Running a build with the libdispatch and install-libdispatch flags added

# ])

# Configure use of Dispatch in CoreFoundation and Foundation if libdispatch is being built
if "LIBDISPATCH_SOURCE_DIR" in Configuration.current.variables:
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't have a ton of context on the changes in this pull request, but thought I'd chime in with a tiny nit-pick: Is there a reason you uncommented this line? That's fine of course, but Python requires if to contain at least one expression. To do nothing, you may use pass:

if "LIBDISPATCH_SOURCE_DIR" in Configuration.current.variables:
    pass

I think if you run this as-is, it would raise a syntax error of some kind.

Copy link
Contributor Author

@seabaylea seabaylea Apr 26, 2016

Choose a reason for hiding this comment

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

Thanks for picking that up. Looks like I missed a line when I re-commented out the block as building Dispatch into Foundation currently hits compile errors in NSOperation (due to some Dispatch overlay work that needs fixing up).

Now fixed

@parkera parkera merged commit b98711e into swiftlang:master Apr 28, 2016
@seabaylea seabaylea deleted the build-dispatch branch May 11, 2016 18:40
atrick pushed a commit to atrick/swift-corelibs-foundation that referenced this pull request Jan 12, 2021
Move to standalone TSC in CI configuration
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.

3 participants