Skip to content
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

prefer versions in package.resolved file when one exists and matches the original manifest #6698

Merged
merged 2 commits into from Aug 8, 2023

Conversation

tomerd
Copy link
Member

@tomerd tomerd commented Jul 12, 2023

prefer versions in package.resolved file when one exists and matches the original manifest

motivation: when a package.resolved file exists the dependencies resolution should stick to it, unless requested otherwise

changes:

  • compute a hash of the source for the package.resolved file and use it to decide if dependency resolution is required or package.resolved is sufficient
  • prefer the versions specified in package.resolved by default and no changes in the original manifest are detected
  • refactor code flow to make the logic easier to reason about
  • add and adjust tests

@tomerd tomerd self-assigned this Jul 12, 2023
@tomerd tomerd force-pushed the prefer-resolved-file branch 3 times, most recently from 5911d6c to c31a952 Compare July 12, 2023 18:58
@abertelrud
Copy link
Contributor

🎉 This looks like something that can greatly improve performance in the common case!

One question about a possible nuance: is a hash of the contents of the package manifest enough to detect a change? I'm thinking of when the manifest looks at the environment (as SwiftPM's own manifest does), where the environment can affect what dependencies the package manifest yields. Would it make sense to look at the results of having the last time the package manifest was evaluated (which should almost always be in the cache) and base the origin hash on those dependencies?

@tomerd tomerd force-pushed the prefer-resolved-file branch 2 times, most recently from c88c10c to 2655c9e Compare August 3, 2023 00:35
@tomerd tomerd changed the title [wip] prefer versions in package.resolved file when one exists and matches the original manifest prefer versions in package.resolved file when one exists and matches the original manifest Aug 3, 2023
@tomerd
Copy link
Member Author

tomerd commented Aug 3, 2023

@swift-ci smoke test

@tomerd
Copy link
Member Author

tomerd commented Aug 3, 2023

@neonichu @abertelrud this is ready for review

@tomerd
Copy link
Member Author

tomerd commented Aug 3, 2023

@swift-ci smoke test

@tomerd
Copy link
Member Author

tomerd commented Aug 3, 2023

@swift-ci smoke test windows

@tomerd
Copy link
Member Author

tomerd commented Aug 3, 2023

@swift-ci smoke test macOS

…the original manifest

motivation: when a package.resoved file exists the dependencies resolution should stick to it, unless requested otherwise

changes:
* compute a hash of the source for the package.resolved file and use it to decide if dependecy resolution is required or pacakge.resolved is sufficient
* prefer the versions specified in package.resolved by default and no changes in the original manifest are detected
* refactor codee flow to make the logic easier to reason about
* add and adjust tests
@tomerd
Copy link
Member Author

tomerd commented Aug 4, 2023

@swift-ci smoke test

@tomerd
Copy link
Member Author

tomerd commented Aug 4, 2023

@swift-ci smoke test

@tomerd
Copy link
Member Author

tomerd commented Aug 4, 2023

@swift-ci smoke test windows

@tomerd tomerd merged commit ab355c7 into apple:main Aug 8, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants