Skip to content

build: switch libdispatch build to cmake #10670

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
Sep 18, 2017

Conversation

compnerd
Copy link
Member

Use the cmake based build system for building libdispatch now that it is
able to build Linux, android, and even possible to cross-compile to
Windows.

Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.

Resolves SR-NNNN.

@compnerd
Copy link
Member Author

@modocache
Copy link
Contributor

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - 0dc9b70926c01884b798f7d07cce0258eaff2df5
Test requested by - @modocache

@compnerd
Copy link
Member Author

swift-corelibs-libdispatch PR#264 should fix the build issue that happened here

@modocache
Copy link
Contributor

Please test with following PR:
swiftlang/swift-corelibs-libdispatch#264

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - 0dc9b70926c01884b798f7d07cce0258eaff2df5
Test requested by - @modocache

@compnerd
Copy link
Member Author

CC @dgrove-oss

@dgrove-oss
Copy link
Contributor

I think we aren't ready to merge this PR yet.

At least for me, I am seeing the libdispatch tests not linking correctly when built with CMake because of missing -L/-rpath to find libSwift. I will put in a dispatch PR for that today.

@compnerd have you build the entire source tree (including swift, swift-corelibs-dispatch, swiftpm, swift-corelibs-foundation) from scratch with CMake driving the libdispatch build with this PR in place for build-script?

@compnerd
Copy link
Member Author

compnerd commented Jul 2, 2017

No, I've not built the entire source tree. I've been focused on the swift compiler/runtime and libdispatch for now. I know of at least one other place where we need to tweak things. But, having an occasional run here is helpful to ensure that I don't accidentally regress the Darwin build. I've been trying to keep the Darwin build untouched. Does it not use the autoconf build? If so, I can greatly simplify this PR. I know that @das has been working on trying to fix up the CMake build for libdispatch to be sufficient for the macOS build, and I'm really looking forward to that to have a single unified build for libdispatch.

@compnerd compnerd force-pushed the dispatch-cmake branch 2 times, most recently from 7af6503 to 8501587 Compare July 2, 2017 18:14
@compnerd
Copy link
Member Author

@swift-ci please test

Lets see where we stand

@gottesmm
Copy link
Contributor

(Just doing a drive by test since the CI didn't seem to kick in).

@gottesmm
Copy link
Contributor

@swift-ci please test

1 similar comment
@gottesmm
Copy link
Contributor

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - 3fdc21bca365c5f74552baa86f81abd758dc93d6
Test requested by - @gottesmm

@compnerd
Copy link
Member Author

Interesting, seems that the linker invocation is missing the -rpath-link for the swift runtime.

@dgrove-oss
Copy link
Contributor

I think the missing -rpath-link is because on the dispatch side it is looking for SWIFT_RUNTIME_LIBDIR to be defined.

-DCMAKE_CXX_COMPILER:PATH="${LLVM_BIN}/clang++"
-DCMAKE_SWIFT_COMPILER:PATH="${SWIFTC_BIN}"
-DCMAKE_INSTALL_PREFIX:PATH="$(get_host_install_destdir ${host})$(get_host_install_prefix ${host})"
-DCMAKE_RUNTIME_LIBDIR:PATH="${DISPATCH_TMPLIBDIR}"
Copy link
Contributor

@dgrove-oss dgrove-oss Jul 27, 2017

Choose a reason for hiding this comment

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

-DSWIFT_RUNTIME_LIBDIR:PATH="${DISPATCH_TMPLIBDIR}"

@compnerd
Copy link
Member Author

Rebased and adjusted as per @dgrove-oss's point.

@compnerd
Copy link
Member Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - 3fdc21bca365c5f74552baa86f81abd758dc93d6
Test requested by - @compnerd

@compnerd compnerd force-pushed the dispatch-cmake branch 2 times, most recently from 4ff8bb8 to dca06d5 Compare July 31, 2017 03:31
@compnerd
Copy link
Member Author

Switched the sourcekit's build to use cmake as well. Adjusted the build-script to fix the rpath for swiftcore

@compnerd
Copy link
Member Author

@swift-ci please test Linux platform

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - b36ced89564d556297778808d58b880e66d2b530
Test requested by - @compnerd

@compnerd
Copy link
Member Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 0e617c165cbbf840d5e4015a42862e1c7b6f553e

@compnerd
Copy link
Member Author

Okay, so, the last failure was an install failure. I think that was caused by me using ${CMAKE_INSTALL_PREFIX} for the install prefix. Switch that to <INSTALL_DIR> which is the temporary install location for the ExternalProject. Hopefully, this should finally get it right.

@compnerd
Copy link
Member Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 0e617c165cbbf840d5e4015a42862e1c7b6f553e

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 0e617c165cbbf840d5e4015a42862e1c7b6f553e

@compnerd
Copy link
Member Author

Okay, swift-corelibs-libdispatch PR303 should fix the symlink issue. It seems that I had them locally which is why I never saw this. I adjusted the dependencies to deal with BlocksRuntime dependencies being needed as well.

@compnerd
Copy link
Member Author

Please test with following pull request:
swiftlang/swift-corelibs-libdispatch#303

@swift-ci Please test Linux platform

Use the cmake based build system for building libdispatch now that it is
able to build Linux, android, and even possible to cross-compile to
Windows.
@CodaFi
Copy link
Contributor

CodaFi commented Sep 18, 2017

Please test with following pull request:
swiftlang/swift-corelibs-libdispatch#303

@swift-ci Please test Linux platform

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - e21d87b33f11ef24cda0296a076746f5c09ec558

@compnerd
Copy link
Member Author

@CodaFi thanks! Great, it now seems to also pass on the build bots! This is great! Need to wait for @das to get the PR#303 merged in libdispatch and then we can switch over to the CMake build! ❤️

@compnerd
Copy link
Member Author

@swift-ci please smoke test macOS platform

@compnerd
Copy link
Member Author

Please test with following pull request:
swiftlang/swift-corelibs-libdispatch#303

@swift-ci Please test macOS platform

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - e21d87b33f11ef24cda0296a076746f5c09ec558

@compnerd
Copy link
Member Author

Just need to wait for the dispatch PR to get merged before this can be merged.

@gottesmm
Copy link
Contributor

@compnerd I am soooo excited about this! Getting rid of autoconf from the build? +1! +1!

@compnerd compnerd merged commit 0ebee3f into swiftlang:master Sep 18, 2017
@compnerd compnerd deleted the dispatch-cmake branch September 18, 2017 21:23
@gottesmm
Copy link
Contributor

Woot!

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.

7 participants