Skip to content

[CMake] Conditionalize generation of .swiftinterface files #20784

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 2 commits into from
Nov 27, 2018

Conversation

jrose-apple
Copy link
Contributor

SWIFT_ENABLE_PARSEABLE_MODULE_INTERFACES is the new setting.

rdar://problem/44942414

@jrose-apple
Copy link
Contributor Author

Still need to fix the tests that expect the swiftinterface files to be there…

SWIFT_ENABLE_PARSEABLE_MODULE_INTERFACES is the new setting.

rdar://problem/44942414
@jrose-apple jrose-apple force-pushed the generated-nine-out-of-ten branch from 3b55b05 to 022fe5d Compare November 27, 2018 01:04
@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 3b55b05596b6628f3f19bb6c5a45fc62f3f6c4aa

Copy link
Contributor

@Rostepher Rostepher left a comment

Choose a reason for hiding this comment

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

LGTM, the CMake changes look straightforward. 👍

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 3b55b05596b6628f3f19bb6c5a45fc62f3f6c4aa

"${CMAKE_COMMAND}" "-E" "remove" "-f" "${module_doc_file}"
COMMAND
"${CMAKE_COMMAND}" "-E" "remove" "-f" "${interface_file}"
"${CMAKE_COMMAND}" "-E" "remove" "-f" ${module_outputs}
Copy link
Member

Choose a reason for hiding this comment

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

If this works, that is great. I recently learnt that the multi-file variant of the commands was added in CMake 3.5 for some of them :/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, hm. It works on my machine™ but I'll go check before I merge.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like it was in 3.4 at least, and our current oldest supported version is 3.4.3.

// RUN: %empty-directory(%t)
// RUN: for x in %platform-sdk-overlay-dir/*.swiftinterface; do [[ $(basename "$x") = Swift.swiftinterface || $(basename "$x") = simd.swiftinterface || $(basename "$x") = SwiftLang.swiftinterface ]] && continue; %target-swift-frontend "$x" -emit-module -o %t/$(basename "$x" .swiftinterface).swiftmodule -disable-objc-attr-requires-foundation-module -enable-resilience -Fsystem %sdk/System/Library/PrivateFrameworks/ -swift-version 4 -O || echo '%target-os:' $(basename "$x") >> %t/failures.txt; done
// RUN: diff <(grep '%target-os:' %s) <(sort -f %t/failures.txt)
// RUN: for x in %platform-sdk-overlay-dir/*.swiftinterface; do [[ $(basename "$x") = Swift.swiftinterface || $(basename "$x") = simd.swiftinterface || $(basename "$x") = SwiftLang.swiftinterface || $(basename "$x") = '*.swiftinterface' ]] && continue; %target-swift-frontend "$x" -emit-module -o %t/$(basename "$x" .swiftinterface).swiftmodule -disable-objc-attr-requires-foundation-module -enable-resilience -Fsystem %sdk/System/Library/PrivateFrameworks/ -swift-version 4 -O || echo '%target-os:' $(basename "$x") >> %t/failures.txt; done
Copy link
Member

Choose a reason for hiding this comment

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

Ugh, this really makes the test difficult to port on windows :-(.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test is kind of a mess anyway. I should probably just write a Python script. But I don't think I've made it worse of a mess than it already was.

@jrose-apple
Copy link
Contributor Author

Unrelated XCTest failure.

@swift-ci Please test Linux

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.

4 participants