Skip to content

[WIP] Invoke the Swift frontend to prescan for dependencies. #47

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

Closed

Conversation

DougGregor
Copy link
Member

Add a new flag -driver-prebuild-module-dependencies to instruct the driver
to have the Swift frontend prescan for dependencies, which will allow the
driver to explicitly schedule builds for both Swift and C modules,
eliminating the need for the frontend to rebuild those modules when it
tries to import them. This allows for an overall more coordinated
build.

At present, this WIP invokes the Swift frontend and then parses the
JSON before dumping out the dependency graph, so it's not actually
useful for anything.

Add a new flag -driver-prebuild-module-dependencies to instruct the driver
to have the Swift frontend prescan for dependencies, which will allow the
driver to explicitly schedule builds for both Swift and C modules,
eliminating the need for the frontend to rebuild those modules when it
tries to import them. This allows for an overall more coordinated
build.

At present, this WIP invokes the Swift frontend and then parses the
JSON before dumping out the dependency graph, so it's not actually
useful for anything.
@DougGregor
Copy link
Member Author

This utilizes the fast dependency scanning work in the Swift compiler itself (swiftlang/swift#28515), which is also a work in progress.

artemcm added a commit to artemcm/swift-driver that referenced this pull request May 18, 2020
This PR resurrects swiftlang#47 and builds on top of it.

Adds new flag -driver-print-module-dependencies-jobs to instruct the driver to scan for dependencies and generate build jobs for each dependent Swift or C module.

At present, this WIP does the following:
- Invoke the Swift frontend Fast Dependency Scanner to prescan for dependencies.
- Construct a Module Dependency Graph from the dependency scanner's JSON output.
- Compute the order in which dependent modules should be built.
- Generate and print build jbos for each dependent module.

Next Steps:
Actually have the driver schedule and execute the dependent module build jobs ahead of time, eliminating the need to re-build those modules when it tries to import them.
artemcm added a commit to artemcm/swift-driver that referenced this pull request May 18, 2020
This PR resurrects swiftlang#47 and builds on top of it.

Adds new flag -driver-print-module-dependencies-jobs to instruct the driver to scan for dependencies and generate build jobs for each dependent Swift or C module.

At present, this WIP does the following:
- Invoke the Swift frontend Fast Dependency Scanner to prescan for dependencies.
- Construct a Module Dependency Graph from the dependency scanner's JSON output.
- Compute the order in which dependent modules should be built.
- Generate and print build jbos for each dependent module.

Next Steps:
Actually have the driver schedule and execute the dependent module build jobs ahead of time, eliminating the need to re-build those modules when it tries to import them.
artemcm added a commit to artemcm/swift-driver that referenced this pull request May 18, 2020
This PR resurrects swiftlang#47 and builds on top of it.

Adds new flag -driver-print-module-dependencies-jobs to instruct the driver to scan for dependencies and generate build jobs for each dependent Swift or C module.

At present, this WIP does the following:
- Invoke the Swift frontend Fast Dependency Scanner to prescan for dependencies.
- Construct a Module Dependency Graph from the dependency scanner's JSON output.
- Compute the order in which dependent modules should be built.
- Generate and print build jbos for each dependent module.

Next Steps:
Actually have the driver schedule and execute the dependent module build jobs ahead of time, eliminating the need to re-build those modules when it tries to import them.
artemcm added a commit to artemcm/swift-driver that referenced this pull request May 18, 2020
This PR resurrects swiftlang#47 and builds on top of it.

Adds new flag -driver-print-module-dependencies-jobs to instruct the driver to scan for dependencies and generate build jobs for each dependent Swift or C module.

At present, this WIP does the following:
- Invoke the Swift frontend Fast Dependency Scanner to prescan for dependencies.
- Construct a Module Dependency Graph from the dependency scanner's JSON output.
- Compute the order in which dependent modules should be built.
- Generate and print build jbos for each dependent module.

Next Steps:
Actually have the driver schedule and execute the dependent module build jobs ahead of time, eliminating the need to re-build those modules when it tries to import them.
artemcm added a commit to artemcm/swift-driver that referenced this pull request May 19, 2020
This PR resurrects swiftlang#47 and builds on top of it.

Adds new flag -driver-print-module-dependencies-jobs to instruct the driver to scan for dependencies and generate build jobs for each dependent Swift or C module.

At present, this WIP does the following:
- Invoke the Swift frontend Fast Dependency Scanner to prescan for dependencies.
- Construct a Module Dependency Graph from the dependency scanner's JSON output.
- Compute the order in which dependent modules should be built.
- Generate and print build jbos for each dependent module.

Next Steps:
Actually have the driver schedule and execute the dependent module build jobs ahead of time, eliminating the need to re-build those modules when it tries to import them.
artemcm added a commit to artemcm/swift-driver that referenced this pull request May 20, 2020
This PR resurrects swiftlang#47 and builds on top of it.

Adds new flag -driver-print-module-dependencies-jobs to instruct the driver to scan for dependencies and generate build jobs for each dependent Swift or C module.

At present, this WIP does the following:
- Invoke the Swift frontend Fast Dependency Scanner to prescan for dependencies.
- Construct a Module Dependency Graph from the dependency scanner's JSON output.
- Compute the order in which dependent modules should be built.
- Generate and print build jbos for each dependent module.

Next Steps:
Actually have the driver schedule and execute the dependent module build jobs ahead of time, eliminating the need to re-build those modules when it tries to import them.
@DougGregor
Copy link
Member Author

@artemcm is doing this properly in #104, so I'll close out this pull request.

@DougGregor DougGregor closed this May 20, 2020
@DougGregor DougGregor deleted the explicit-module-builds branch May 20, 2020 17:39
artemcm added a commit to artemcm/swift-driver that referenced this pull request May 20, 2020
This PR resurrects swiftlang#47 and builds on top of it.

Adds new flag -driver-print-module-dependencies-jobs to instruct the driver to scan for dependencies and generate build jobs for each dependent Swift or C module.

At present, this WIP does the following:
- Invoke the Swift frontend Fast Dependency Scanner to prescan for dependencies.
- Construct a Module Dependency Graph from the dependency scanner's JSON output.
- Generate and print build jbos for each dependent module.

Next Steps:
Actually have the driver schedule and execute the dependent module build jobs ahead of time, eliminating the need to re-build those modules when it tries to import them.
artemcm added a commit to artemcm/swift-driver that referenced this pull request May 20, 2020
This PR resurrects swiftlang#47 and builds on top of it.

Adds new flag -driver-print-module-dependencies-jobs to instruct the driver to scan for dependencies and generate build jobs for each dependent Swift or C module.

At present, this WIP does the following:
- Invoke the Swift frontend Fast Dependency Scanner to prescan for dependencies.
- Construct a Module Dependency Graph from the dependency scanner's JSON output.
- Generate and print build jbos for each dependent module.

Next Steps:
Actually have the driver schedule and execute the dependent module build jobs ahead of time, eliminating the need to re-build those modules when it tries to import them.
artemcm added a commit to artemcm/swift-driver that referenced this pull request May 20, 2020
This PR resurrects swiftlang#47 and builds on top of it.

Adds new flag -driver-print-module-dependencies-jobs to instruct the driver to scan for dependencies and generate build jobs for each dependent Swift or C module.

At present, this WIP does the following:
- Invoke the Swift frontend Fast Dependency Scanner to prescan for dependencies.
- Construct a Module Dependency Graph from the dependency scanner's JSON output.
- Generate and print build jbos for each dependent module.

Next Steps:
Actually have the driver schedule and execute the dependent module build jobs ahead of time, eliminating the need to re-build those modules when it tries to import them.
artemcm added a commit to artemcm/swift-driver that referenced this pull request May 21, 2020
This PR resurrects swiftlang#47 and builds on top of it.

Adds new flag -driver-print-module-dependencies-jobs to instruct the driver to scan for dependencies and generate build jobs for each dependent Swift or C module.

At present, this WIP does the following:
- Invoke the Swift frontend Fast Dependency Scanner to prescan for dependencies.
- Construct a Module Dependency Graph from the dependency scanner's JSON output.
- Generate and print build jbos for each dependent module.

Next Steps:
Actually have the driver schedule and execute the dependent module build jobs ahead of time, eliminating the need to re-build those modules when it tries to import them.
artemcm added a commit to artemcm/swift-driver that referenced this pull request May 21, 2020
This PR resurrects swiftlang#47 and builds on top of it.

Adds new flag -driver-print-module-dependencies-jobs to instruct the driver to scan for dependencies and generate build jobs for each dependent Swift or C module.

At present, this WIP does the following:
- Invoke the Swift frontend Fast Dependency Scanner to prescan for dependencies.
- Construct a Module Dependency Graph from the dependency scanner's JSON output.
- Generate and print build jbos for each dependent module.

Next Steps:
Actually have the driver schedule and execute the dependent module build jobs ahead of time, eliminating the need to re-build those modules when it tries to import them.
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.

1 participant