Skip to content

Conversation

@artemcm
Copy link
Contributor

@artemcm artemcm commented Aug 19, 2020

  • Factor out placeholder dependency resolution out of the ExplicitModuleHandler into the Driver
  • Generate and post-process the dependency graph before passing it on to the ExplicitModuleHandler:
    • Run the Swift Fast Dependency Scanner.
    • Resolve placeholder dependencies, if any.
    • Re-scan and update Clang modules with a super-set of their dependencies against all compilation targets.

Some background on this issue:
When building a Swift module at a fixed target version, the module may have dependencies which specify a different target version. It is possible that in this case, multiple swift modules, with different targets, have a dependency on the same Clang module. There is a hard requirement that the target version of the Clang module compilation match exactly the target version of the depending Swift module compilation.

The problem this PR addresses:
Dependency scanning results may vary depending on the target version specified on the dependency scanning action. If the scanning action is performed at a fixed target, and the scanned module is later compiled with a higher version target, miscomputation may occur due to dependencies present only at the higher version number and thus not detected by the dependency scanner.

Uses the newly-added Clang dependency scanning mode in the swift-frontend, added here:
swiftlang/swift#33522

Resolves rdar://67079780

@artemcm artemcm requested review from DougGregor and nkcsgexi August 19, 2020 19:49
@artemcm
Copy link
Contributor Author

artemcm commented Aug 19, 2020

@swift-ci please test

Copy link
Contributor

@nkcsgexi nkcsgexi left a comment

Choose a reason for hiding this comment

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

We may need to switch to the batch scanning mode soon 😄

…s against which they will be built.

- Factor out placeholder dependency resolution out of the ExplicitModuleHandler into the Driver
- Generate and post-process the dependency graph before passing it on to the ExplicitModuleHandler:
  - Run the Swift Fast Dependency Scanner.
  - Resolve placeholder dependencies, if any.
  - Re-scan and update Clang modules with a super-set of their dependencies against all compilation targets.
@artemcm artemcm force-pushed the VersionedClangModuleScanning branch from 89bfd70 to 673548f Compare August 20, 2020 21:52
@artemcm
Copy link
Contributor Author

artemcm commented Aug 20, 2020

@swift-ci please test

1 similar comment
@artemcm
Copy link
Contributor Author

artemcm commented Aug 20, 2020

@swift-ci please test

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