Skip to content

Merge darwin/libdispatch-806 to master and apply Linux build fixes #215

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 110 commits into from
Feb 22, 2017

Conversation

das
Copy link
Contributor

@das das commented Feb 21, 2017

Merge tag darwin/libdispatch-806 on darwin/trunk.

This includes Apple source drops libdispatch-743, libdispatch-749 & libdispatch-806 as well as all the github PR’s that we’ve pulled back into our internal repository since PR #142 (along with any changes made to these during internal review and testing on Darwin.)

One of the bigger changes included is a switch away from libkqueue to a native epoll()-based event loop backend

@dgrove-oss has a patch ready to apply on top of this with Linux build fixes

DougGregor and others added 30 commits February 20, 2017 18:47
Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
[SE-0111] Update for removal of argument labels from function types

Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
fix issues preventing overlay from compiling due to SE-0025

Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
Update for Unsafe(Mutable)Pointer changes.

Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
[SE-0101] Migrate sizeof family to MemoryLayout

Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
Adding @escaping option as required by the compiler.

Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
[SE-0103][noescape by default] Migration to @NoEscape by default feature.

Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
Update libpwq for fix to race condition in libpwq's test_api

Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
…endency

Eliminate the external dependency on libBlocksRuntime.so by
copying the blocks runtime code from swift-corelibs-foundation/closure
and building it into libdispatch.  Added a configure option to control
whether or not the blocks runtime is embedded; defaults to embedded on
Linux and not embedded on other platforms.  Since the blocks runtime is
embedded; we can take the link directive out of the module.modulemap file.

This change enables dispatch to be built and run on a system without
the libblocksruntime-dev package installed.

Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
SR-2309: embed BlocksRuntime in libdispatch to eliminate external dep…

Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
Added Toolchain section in INSTALL.md

Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
update INSTALL.md and README.md

Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
fixes for compilation/linking problems on linux

Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
ktopley-apple and others added 15 commits February 20, 2017 18:47
…Uint8> with a nil address.

Radar 29337927

Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
Fixes crash when DispatchData is created from an UnsafeBufferPointer<UInt8> with a nil address (Radar 29337927)

Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
…seconds: 0)

(Radar 28814085)
(SR-2807)

Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
Adding documentation to clarify the result of DispatchTime(uptimeNanoseconds: 0)

Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
Remove ObjC support functions not needed on non-ObjC platforms

Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
The include of sys/user.h is not needed; it
is a leftover from the initial linux port.
Eliminating it avoids a build problem for
the Swift dispatch overlay on ubuntu 14.04
powerpc64le because the content of sys/user.h
confuses the clang module importer when it
attempts to import CDispatch.

Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
Remove unused include of sys/user.h

Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
@das das self-assigned this Feb 21, 2017
@das das requested a review from dgrove-oss February 21, 2017 04:08
@das
Copy link
Contributor Author

das commented Feb 21, 2017

w.r.t Swift 3.1 backport for this, the number of diffs between master and swift-3.1-branch is so small right now (and all look like they should be included in Swift 3.1) that it probably makes sense to just merge master into swift-3.1-branch after we merge this ?

dgrove-oss and others added 2 commits February 21, 2017 22:26
Collection of small fixes to dispatch-806 merge to
allow code to compile/link/run on Linux.
…rge-master-linux-fixes

Linux fixes for dispatch-806 merge
@das
Copy link
Contributor Author

das commented Feb 22, 2017

@swift-ci Please test

@das
Copy link
Contributor Author

das commented Feb 22, 2017

looks like the CI build failed with

make[1]: Entering directory '/home/buildnode/disk2/workspace/swift-corelibs-libdispatch-PR-Linux/swift-corelibs-libdispatch/libpwq'
make[1]: *** No rule to make target 'distclean'.  Stop.
make[1]: Leaving directory '/home/buildnode/disk2/workspace/swift-corelibs-libdispatch-PR-Linux/swift-corelibs-libdispatch/libpwq'
Makefile:457: recipe for target 'distclean-recursive' failed
make: *** [distclean-recursive] Error 1
FAILED: cd /home/buildnode/disk2/workspace/swift-corelibs-libdispatch-PR-Linux/swift-corelibs-libdispatch && autoreconf -fvi && /usr/bin/env CC=/home/buildnode/disk2/workspace/swift-corelibs-libdispatch-PR-Linux/Ninja-ReleaseAssert/llvm-linux-x86_64/bin/clang CXX=/home/buildnode/disk2/workspace/swift-corelibs-libdispatch-PR-Linux/Ninja-ReleaseAssert/llvm-linux-x86_64/bin/clang++ OBJC=/home/buildnode/disk2/workspace/swift-corelibs-libdispatch-PR-Linux/Ninja-ReleaseAssert/llvm-linux-x86_64/bin/clang /home/buildnode/disk2/workspace/swift-corelibs-libdispatch-PR-Linux/swift-corelibs-libdispatch/configure --prefix="/usr" && /usr/bin/make && /bin/mkdir -p /home/buildnode/disk2/workspace/swift-corelibs-libdispatch-PR-Linux/Ninja-ReleaseAssert/libdispatch-linux-x86_64/src/.libs/ && /bin/cp /home/buildnode/disk2/workspace/swift-corelibs-libdispatch-PR-Linux/swift-corelibs-libdispatch/src/.libs/libdispatch.so /home/buildnode/disk2/workspace/swift-corelibs-libdispatch-PR-Linux/Ninja-ReleaseAssert/libdispatch-linux-x86_64/src/.libs/libdispatch.so && /usr/bin/make distclean
ninja: build stopped: subcommand failed.
/home/buildnode/disk2/workspace/swift-corelibs-libdispatch-PR-Linux/swift/utils/build-script: fatal error: command terminated with a non-zero exit status 1, aborting
Build step 'Execute shell' marked build as failure

@dgrove-oss is that something new with this branch ?

@das
Copy link
Contributor Author

das commented Feb 22, 2017

this seems suspicious (Build #68)

autoreconf: configure.ac: adding subdirectory libpwq to autoreconf
autoreconf: Entering directory `libpwq'
autoreconf: configure.ac: not using Autoconf
autoreconf: Leaving directory `libpwq'

and there was no configure of libpwq

maybe this is a submodule initialization issue again ?

@dgrove-oss
Copy link
Contributor

dgrove-oss commented Feb 22, 2017

I agree it looks like the PR testing by swift-ci didn't do the submodule init/update step when it checked out libdispatch. When that happens, the build "succeeds" by configuring libdispatch to not use libpwq and we manage to build a libdispatch.so but this is a fairly broken configuration. It falls over on the 'make distclean' because the top-level Makefile includes libpwq as a subdir, but libpwq is empty (and therefore not configured or included in the build).

Post merge, we probably should try to fail the build earlier instead of allowing Linux to build without libpwq (at least for as long as we have libpwq as a submodule). I think a tweak to the configure.ac would do it.

@das
Copy link
Contributor Author

das commented Feb 22, 2017

ok, thanks, makes sense, I'll go ahead and merge without despite the CI build failure then, given you had built this manually for Linux with the #216 patch.

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.