Skip to content

Makefile.rules: Replace Swift frontend invocations with Swift driver #7971

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

Conversation

adrian-prantl
Copy link

Currently Makefile.rules micro-manages Swift compilation, which is great for control, but also risky because the testsuite doesn't track new behavior in the Swift driver. As the Swift driver gains more and more build system functionality (e.g., explicit modules) we can simplify our Makefile while getting closer to what users actually see when using the Swift driver or build systems that include it as a library.

The most notable difference this patch introduces is that we will now compile all Swift sources in a single Swift driver invocation, generating an output file list.

@adrian-prantl
Copy link
Author

@swift-ci test

# FIXME: This should work with precise compiler invocations.
#self.expect("expression foo", "expected result", substrs=["$R3", "23"])
#self.expect("expression $R3", "expected result", substrs=["23"])
#self.expect("expression $R4", "expected result", substrs=["23"])

Choose a reason for hiding this comment

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

same question, should this remain commented out?

Copy link
Author

Choose a reason for hiding this comment

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

This looks like a regression, but in reality the output here is random based on the order in which modules are visited. The right thing to do is to enable this only when precise compiler invocations are on, but the decorator isn't powerful enough to detect this. I'll need to follow-up here.

@adrian-prantl
Copy link
Author

@swift-ci test

@adrian-prantl
Copy link
Author

@swift-ci test windows

@adrian-prantl
Copy link
Author

@swift-ci test

@adrian-prantl
Copy link
Author

@swift-ci test windows

@adrian-prantl
Copy link
Author

@swift-ci test

@adrian-prantl
Copy link
Author

@swift-ci test windows

@adrian-prantl
Copy link
Author

@swift-ci test

@adrian-prantl
Copy link
Author

@swift-ci test windows

@adrian-prantl
Copy link
Author

I just need to fix up Linux now.

@adrian-prantl
Copy link
Author

@swift-ci test

@adrian-prantl
Copy link
Author

@swift-ci test windows

@adrian-prantl
Copy link
Author

@swift-ci test

@adrian-prantl
Copy link
Author

@swift-ci test windows

@adrian-prantl
Copy link
Author

@swift-ci test

@adrian-prantl
Copy link
Author

@swift-ci test

@adrian-prantl
Copy link
Author

@swift-ci test windows

@adrian-prantl adrian-prantl force-pushed the embrace-swift-driver branch 2 times, most recently from 5816ecd to 8ad3b48 Compare January 19, 2024 20:51
@adrian-prantl
Copy link
Author

@swift-ci test

@adrian-prantl
Copy link
Author

@swift-ci test

@adrian-prantl
Copy link
Author

@swift-ci test windows

@adrian-prantl
Copy link
Author

@swift-ci test

@adrian-prantl
Copy link
Author

@swift-ci test windows

2 similar comments
@adrian-prantl
Copy link
Author

@swift-ci test windows

@adrian-prantl
Copy link
Author

@swift-ci test windows

@adrian-prantl adrian-prantl force-pushed the embrace-swift-driver branch 2 times, most recently from 9dcd3b3 to d6845b9 Compare January 20, 2024 00:08
@adrian-prantl
Copy link
Author

@swift-ci test

@adrian-prantl
Copy link
Author

@swift-ci test windows

Currently Makefile.rules micro-manages Swift compilation, which is
great for control, but also risky because the testsuite doesn't track
new behavior in the Swift driver. As the Swift driver gains more and
more build system functionality (e.g., explicit modules) we can
simplify our Makefile while getting closer to what users actually see
when using the Swift driver or build systems that include it as a
library.

The most notable difference this patch introduces is that we
will now compile all Swift sources in a single Swift driver
invocation, generating an output file list.
@adrian-prantl
Copy link
Author

@swift-ci test linux

@adrian-prantl
Copy link
Author

@swift-ci test

@adrian-prantl
Copy link
Author

@swift-ci test windows

@adrian-prantl adrian-prantl merged commit 1b1a7d8 into swiftlang:stable/20230725 Jan 22, 2024
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