Skip to content

Support background preparation of targets #1273

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 3 commits into from
May 13, 2024

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented May 9, 2024

No description provided.

@ahoppen ahoppen requested a review from hamishknight May 9, 2024 19:59
@ahoppen ahoppen requested a review from benlangmuir as a code owner May 9, 2024 19:59
@ahoppen
Copy link
Member Author

ahoppen commented May 9, 2024

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented May 9, 2024

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented May 9, 2024

@swift-ci Please test Windows

1 similar comment
@ahoppen
Copy link
Member Author

ahoppen commented May 9, 2024

@swift-ci Please test Windows

Comment on lines 244 to 260
try self.workspace.resolve(
root: PackageGraphRootInput(packages: [AbsolutePath(projectRoot)]),
observabilityScope: observabilitySystem.topScope
)
try await self.reloadPackage()
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like reloadPackage calls loadPackageGraph, which calls into _resolve, is our call to resolve necessary?

Copy link
Member Author

Choose a reason for hiding this comment

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

There is a subtle difference here that we don’t set forceResolvedVersions: true here. This ensures that we generate a Package.resolved if none exists. I think we need to do some more design work here about when we should do it. I’ll file an issue for it and do it in a follow-up PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

OK, I had to set forceResolvedVersions: false during an index build anyway. 5e83d7d

ahoppen added 3 commits May 10, 2024 11:58
…ld directory

When `SwiftPMBuildSystem` operates on a ` .index-build` directory, it owns the checkouts and is thus also allowed to resolve the package versions. This is necessary
@ahoppen ahoppen force-pushed the background-preparation branch from 7d8e10c to 740262c Compare May 10, 2024 21:43
@ahoppen
Copy link
Member Author

ahoppen commented May 10, 2024

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented May 10, 2024

@swift-ci Please test Windows

@ahoppen
Copy link
Member Author

ahoppen commented May 13, 2024

@swift-ci Please test Windows

@ahoppen ahoppen merged commit 0e0ef0d into swiftlang:main May 13, 2024
3 checks passed
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