Skip to content

[5.2][cmake] Add support for exporting frameworks/libraries into cmake exp… #29282

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
Jan 29, 2020
Merged

Conversation

atrick
Copy link
Contributor

@atrick atrick commented Jan 17, 2020

…ort files.

I think this was just an oversight. The new cmake 3.16 seems to choke if we do
not add SourceKit to the exports file since there are dependencies upon it in
other swift libraries.

(cherry picked from commit 8d712af)

…ort files.

I think this was just an oversight. The new cmake 3.16 seems to choke if we do
not add SourceKit to the exports file since there are dependencies upon it in
other swift libraries.

(cherry picked from commit 8d712af)
@atrick atrick requested a review from a team as a code owner January 17, 2020 20:54
@atrick
Copy link
Contributor Author

atrick commented Jan 17, 2020

@swift-ci test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 259afb2

@atrick
Copy link
Contributor Author

atrick commented Jan 18, 2020

@gottesmm It's not clear how changing the sourcekit cmake broke this... I'll PR test again to see what happens...

3:59:40 + /home/buildnode/jenkins/workspace/swift-PR-Linux/branch-swift-5.2-branch/cmake-linux-x86_64/bin/cmake --build /home/buildnode/jenkins/workspace/swift-PR-Linux/branch-swift-5.2-branch/buildbot_linux/cmark-linux-x86_64 -- -j16 test
13:59:40 [0/1][  0%][0.000s] Running tests...
13:59:40 Test project /home/buildnode/jenkins/workspace/swift-PR-Linux/branch-swift-5.2-branch/buildbot_linux/cmark-linux-x86_64
13:59:40     Start 1: api_test
13:59:40 1/9 Test #1: api_test .........................   Passed    0.00 sec
13:59:40     Start 2: html_normalization
13:59:40 2/9 Test #2: html_normalization ...............   Passed    0.53 sec
13:59:40     Start 3: spectest_library
13:59:43 3/9 Test #3: spectest_library .................   Passed    2.79 sec
13:59:43     Start 4: pathological_tests_library
13:59:57 4/9 Test #4: pathological_tests_library .......***Failed   13.58 sec
13:59:57     Start 5: roundtriptest_library
13:59:58 5/9 Test #5: roundtriptest_library ............   Passed    1.14 sec
13:59:58     Start 6: entity_library
13:59:59 6/9 Test #6: entity_library ...................   Passed    0.64 sec
13:59:59     Start 7: spectest_executable
14:01:08 7/9 Test #7: spectest_executable ..............   Passed   69.55 sec
14:01:08     Start 8: smartpuncttest_executable
14:01:12 8/9 Test #8: smartpuncttest_executable ........   Passed    3.84 sec
14:01:12     Start 9: regressiontest_executable
14:01:14 9/9 Test #9: regressiontest_executable ........   Passed    2.51 sec
14:01:15 
14:01:15 89% tests passed, 1 tests failed out of 9
14:01:15 
14:01:15 Total Test time (real) =  94.71 sec
14:01:15 
14:01:15 The following tests FAILED:
14:01:15 	  4 - pathological_tests_library (Failed)
14:01:15 Errors while running CTest
14:01:15 FAILED: CMakeFiles/test.util 

@atrick
Copy link
Contributor Author

atrick commented Jan 18, 2020

@swift-ci test linux

@atrick
Copy link
Contributor Author

atrick commented Jan 18, 2020

@gottesmm this needs CCC to be merged.

@atrick
Copy link
Contributor Author

atrick commented Jan 24, 2020

@gottesmm I'm not the right person to writeup CCC for this. Feel from to create your own PR, or attach your CCC to this one (which has passed the tests).

@atrick atrick changed the title [cmake] Add support for exporting frameworks/libraries into cmake exp… [5.2][cmake] Add support for exporting frameworks/libraries into cmake exp… Jan 29, 2020
@atrick atrick requested a review from benlangmuir January 29, 2020 17:28
@atrick
Copy link
Contributor Author

atrick commented Jan 29, 2020

--- CCC for 5.2 merge ---

Original Author: Michael Gottesman

Explanation:

Swift's CMake communicates dependencies to downstream cmake projects via SwiftConfig.cmake. This is done by "exporting" the dependency into the config file. The exporting results in that file containing the declaration of an imported target. When the downstream cmake wants to use binaries provided by the imported target, it just includes the SwiftConfig.cmake file and gets all of the name/location it needs.
In older versions of cmake, we were able to get away with not actually exporting sourcekitd, but successfully linking. The new CMake seems to be significantly stricter and wants us to actually create a true export for sourcekitd. This commit adds that support. There should be no functional change here since we were definitely linking against sourcekitd before. (edited)

Scope: Most local development machines are running cmake 3.16. All these machines will fail to build the swift-5.2-branch because it did not pickup this cmake fix from master.

Risk: Zero

Testing: Local build and PR test

Reviewer: Ben Langmuir

@atrick
Copy link
Contributor Author

atrick commented Jan 29, 2020

@swift-ci test

@tkremenek tkremenek merged commit dfd6d1c into swiftlang:swift-5.2-branch Jan 29, 2020
@atrick atrick deleted the 5.2-fix-cmake branch February 26, 2020 06:16
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.

5 participants