Skip to content

Dependencies Scanner: report compiled Swift module paths if they are available #32633

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

nkcsgexi
Copy link
Contributor

@nkcsgexi nkcsgexi commented Jun 30, 2020

For the explicit module mode, swift-driver uses -compile-module-from-interface to
generate modules from interfaces found by the dependency scanner. However, we don't
need to build the binary module if up-to-date modules are available, either adjacent
to the interface file or in the prebuilt module cache directory. This patch teaches
dependencies scanner to report these ready-to-use binary modules.

@nkcsgexi nkcsgexi changed the title Front-end: teach -compile-module-from-interface to generate forwarding module [WIP] Front-end: teach -compile-module-from-interface to generate forwarding module Jun 30, 2020
@nkcsgexi
Copy link
Contributor Author

@swift-ci please smoke test

1 similar comment
@nkcsgexi
Copy link
Contributor Author

nkcsgexi commented Jul 1, 2020

@swift-ci please smoke test

@nkcsgexi nkcsgexi force-pushed the build-forward-module-from-command-line branch 3 times, most recently from d924da8 to 99a2ebe Compare July 1, 2020 14:44
@nkcsgexi
Copy link
Contributor Author

nkcsgexi commented Jul 1, 2020

@swift-ci please smoke test

@nkcsgexi nkcsgexi force-pushed the build-forward-module-from-command-line branch from 99a2ebe to 1b926de Compare July 1, 2020 16:54
…available

For the explicit module mode, swift-driver uses -compile-module-from-interface to
generate modules from interfaces found by the dependency scanner. However, we don't
need to build the binary module if up-to-date modules are available, either adjacent
to the interface file or in the prebuilt module cache directory. This patch teaches
dependencies scanner to report these ready-to-use binary modules.
@nkcsgexi nkcsgexi force-pushed the build-forward-module-from-command-line branch from 1b926de to 84dd4db Compare July 1, 2020 18:56
@nkcsgexi nkcsgexi changed the title [WIP] Front-end: teach -compile-module-from-interface to generate forwarding module [WIP] Dependencies Scanner: report compiled Swift module paths if they are available Jul 1, 2020
@nkcsgexi
Copy link
Contributor Author

nkcsgexi commented Jul 1, 2020

@swift-ci please smoke test

@nkcsgexi
Copy link
Contributor Author

nkcsgexi commented Jul 1, 2020

@swift-ci please test

1 similar comment
@nkcsgexi
Copy link
Contributor Author

nkcsgexi commented Jul 1, 2020

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented Jul 1, 2020

Build failed
Swift Test Linux Platform
Git Sha - 4cbf85da919c7677d75e85f2b84627dffd53ac5d

@nkcsgexi nkcsgexi changed the title [WIP] Dependencies Scanner: report compiled Swift module paths if they are available Dependencies Scanner: report compiled Swift module paths if they are available Jul 1, 2020
@swift-ci
Copy link
Contributor

swift-ci commented Jul 1, 2020

Build failed
Swift Test OS X Platform
Git Sha - 4cbf85da919c7677d75e85f2b84627dffd53ac5d

@DougGregor
Copy link
Member

I'd like to talk about this approach a bit more. My mental model is that the fast dependency scanner should not make any decisions about what is up-to-date and what isn't. Rather, it should model all of the relationships that can exist between the various sources and compiled products, and let the build system decide what is "up-to-date".

@nkcsgexi
Copy link
Contributor Author

nkcsgexi commented Jul 6, 2020

@DougGregor , @artemcm and I were having a discussion about this and I'm now convinced that reporting only the ready-to-use binary modules is omitting information build systems can later reuse. I'll land additional commits to: (1) reporting candidate ready-to-use binary modules for a Swift interface from the dependency scanner, (2) -compile-module-from-interface should take these candidate modules as explicit module inputs, and (3) -compile-module-from-interface should emit a forwarding-module to a candidate module if it's up-to-date by checking content hash.

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