Skip to content

[Incremental, Testing] Implement 7 more removal tests. #702

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 5 commits into from
Jun 7, 2021

Conversation

davidungar
Copy link
Contributor

Tests all combinations of removeInputFromInvocation, removeSwiftDepsFile, & restoreBadPriors.
The last condition simulates a case where a file is removed but somehow the driver does not get to remove the priors, which has entries for the removed file.
For that condition, the test passes but prints out a warning.
A subsequent PR will fix this issue.

@davidungar
Copy link
Contributor Author

@swift-ci please test

@davidungar davidungar requested a review from artemcm June 5, 2021 00:36
@davidungar
Copy link
Contributor Author

@swift-ci please test

.readGraph,
.enablingCrossModule,
.maySkip("main", "other", "another"),
.missing("another"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe I am misreading things, but in this case, "another" is the input for which we removed the swiftdeps file above, right? Should it not then be removedInput instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great catch! Thank you.

graph.ensureOmits(name: topLevelName)
if removeInputFromInvocation {
if afterRestoringBadPriors {
// FIXME: Fix the driver
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please add a little bit more detail to this FIXME?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great idea! Adding the following: ```
// If you incrementally compile with a.swift and b.swift,
// at the end, the driver saves a serialized ModuleDependencyGraph
// contains nodes for declarations defined in both files.
// If you then later remove b.swift and recompile, the driver will
// see that a file was removed (via comparisons with the saved `BuildRecord`
// and will delete the saved priors. However, if for some reason the
// saved priors are not deleted, the driver will read saved priors
// containing entries for the deleted file. This test simulates that
// condition by restoring the deleted priors. The driver ought to be fixed
// to cull any entries for removed files from the deserialized priors.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me know if the above needs anything--thanks!

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks good, thanks!

@davidungar
Copy link
Contributor Author

@swift-ci please test

davidungar pushed a commit to davidungar/swift-driver that referenced this pull request Jun 7, 2021
@davidungar davidungar merged commit 29ee108 into swiftlang:main Jun 7, 2021
@davidungar
Copy link
Contributor Author

rdar://77998890

@davidungar davidungar deleted the add-remove-4 branch June 18, 2021 21:29
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