Skip to content

[Explicit Module Builds] Avoid adding cross-target input dependencies to intermediate build artifact jobs. #2804

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
Jul 7, 2020

Conversation

artemcm
Copy link
Contributor

@artemcm artemcm commented Jul 6, 2020

For a given target, in the Explicit Module Build world, swift-driver produces jobs to build the main module and jobs to build all module dependencies.
Cross-target dependencies should be added as explicit inputs to a target's main module build job, but not intermediate build dependency jobs.

Always adding cross-target dependencies as inputs can lead to cycles in the build manifest when multiple targets share common intermediate module dependencies.

@artemcm
Copy link
Contributor Author

artemcm commented Jul 6, 2020

@swift-ci smoke test

// common intermediate dependency modules, such dependencies can lead
// to cycles in the resulting manifest.
var manifestNodeInputs = jobInputs
if !job.inputs.contains(where: { $0.type == .swiftInterface }) &&
Copy link
Member

Choose a reason for hiding this comment

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

Should this predicate be given a name and sunk into swift-driver itself?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that's a good idea.

… to intermediate build artifact jobs.

For a given target, in the Explicit Module Build world, swift-driver produces jobs to build the main module and jobs to build all module dependencies.
cross-target dependencies should be added as explicit inputs to a target's main module build job, but not intermediate build dependency jobs.

Always adding cross-target dependencies as inputs can lead to cycles in the build manifest when multiple targets share common intermediate module dependencies.
@artemcm artemcm force-pushed the ExplicitBuildCycles branch from 4eb57e1 to 2dd4dfc Compare July 6, 2020 20:44
@artemcm
Copy link
Contributor Author

artemcm commented Jul 6, 2020

@swift-ci smoke test

@artemcm artemcm merged commit cd5ed28 into swiftlang:master Jul 7, 2020
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.

2 participants