Skip to content

Print commands required to explicitly build module dependencies. #104

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
May 21, 2020

Conversation

artemcm
Copy link
Contributor

@artemcm artemcm commented May 18, 2020

This PR resurrects #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 ModuleDependencyGraph from the dependency scanner's JSON output.
  • Generate and print build jobs 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.

I am new to writing Swift so I encourage reviewers to nit-pick with extreme prejudice.

@artemcm artemcm requested review from DougGregor and nkcsgexi May 18, 2020 17:52
@artemcm
Copy link
Contributor Author

artemcm commented May 18, 2020

Do we have a swift style guide akin to: https://llvm.org/docs/CodingStandards.html ?

@harlanhaskins
Copy link
Contributor

As far as API design and naming questions: https://swift.org/documentation/api-design-guidelines/

For other stylistic decisions, this style guide is pretty close to standard library style, and should be preferred for this project as well IMO: https://google.github.io/swift

Copy link
Contributor

@cltnschlosser cltnschlosser left a comment

Choose a reason for hiding this comment

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

Just some project context and thoughts on error handling.

@artemcm artemcm force-pushed the ExplicitModuleDependencyJobGen branch 2 times, most recently from bbaf4b9 to e3aef4d Compare May 18, 2020 22:59
Copy link
Contributor

@owenv owenv left a comment

Choose a reason for hiding this comment

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

Cool!

@artemcm artemcm force-pushed the ExplicitModuleDependencyJobGen branch from e3aef4d to 412c1f8 Compare May 19, 2020 17:58
@artemcm artemcm force-pushed the ExplicitModuleDependencyJobGen branch from 412c1f8 to d1b8f88 Compare May 20, 2020 16:20
@artemcm
Copy link
Contributor Author

artemcm commented May 20, 2020

@swift-ci test

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

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

Most of the changes needed are minor and can be handled in a follow-up, but please add some tests with some simple Clang + Swift modules and their dependencies, so we can check that a reasonable set of jobs are printed.

@artemcm artemcm force-pushed the ExplicitModuleDependencyJobGen branch from d1b8f88 to 73fbc9b Compare May 20, 2020 19:44
@artemcm artemcm changed the title [WIP] Print commands required to explicitly build module dependencies. Print commands required to explicitly build module dependencies. May 20, 2020
@artemcm artemcm force-pushed the ExplicitModuleDependencyJobGen branch from 73fbc9b to 60197c8 Compare May 20, 2020 21:54
Copy link
Contributor

@owenv owenv left a comment

Choose a reason for hiding this comment

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

Just noticed this after we ran into it on another PR -- Please add the new files to the appropriate CMakeLists.txt before merging

@artemcm artemcm force-pushed the ExplicitModuleDependencyJobGen branch from 60197c8 to 20234bb Compare May 20, 2020 22:38
@artemcm
Copy link
Contributor Author

artemcm commented May 20, 2020

@owenv, thanks for catching this.

@artemcm artemcm force-pushed the ExplicitModuleDependencyJobGen branch from 20234bb to e29950d Compare May 21, 2020 00:27
@DougGregor
Copy link
Member

@swift-ci please test

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 artemcm force-pushed the ExplicitModuleDependencyJobGen branch from e29950d to d8c6c24 Compare May 21, 2020 16:35
@artemcm
Copy link
Contributor Author

artemcm commented May 21, 2020

@swift-ci please test

1 similar comment
@DougGregor
Copy link
Member

@swift-ci please test

@artemcm artemcm merged commit 0d10e67 into swiftlang:master May 21, 2020
@artemcm artemcm deleted the ExplicitModuleDependencyJobGen branch January 20, 2021 19:00
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