-
-
Notifications
You must be signed in to change notification settings - Fork 569
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
.package.resolved
is not generated
#6335
Comments
Copied from Slack:
Here's the example project: |
For anyone interested in looking into this one, Tuist copies the
I'd investigate if there's a way to control where the file gets generated, so that we prevent the race condition. |
My original problem and Lilfaen's problem (comment #2) appear to have different causes and should be considered as separate issues. Now, I cloned Tusit locally and tried to debug it.
In my minimal reproduction repository, |
@tdkn how are you integrating those packages? If you are referencing those as |
@pepicrft
graph TD;
main_target["main target (TuistMinimalReproduction)"] --> MyPackage;
MyPackage --> swift-algorithms["swift-algorithms"];
swift-algorithms["swift-algorithms"] --> swift-numerics["swift-numerics"]
// Project.swift
let project = Project(
name: "TuistMinimalReproduction",
packages: [
.package(path: "MyPackage"),
],
targets: [
.target(
name: "TuistMinimalReproduction",
/* ... */
dependencies: [
.package(product: "MyPackage", type: .runtime),
]
),
]
) // MyPackage/Package.swift
let package = Package(
name: "MyPackage",
platforms: [.macOS(.v13), .iOS(.v16)],
products: [
.library(name: "MyPackage", targets: ["MyPackage"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-algorithms", .upToNextMajor(from: "1.2.0")),
],
targets: [
.target(
name: "MyPackage",
dependencies: [
.product(name: "Algorithms", package: "swift-algorithms"),
]
),
]
) When you open the workspace with tuist generate, Xcode will resolve the dependencies, as shown in the attached screenshot below. It then writes it to MyWorkspace.xcworkspace/xcshareddata/swiftpm/Package.resolved. So tuist should generate |
Thanks @tdkn 🙏🏼. That's, in fact, what we do; after we generate the project, we call an |
Hmm, in this issue situation, I don't think In this reproduction, I believe that And if I intentionally comment out line SwiftPackageManagerInteractor.swift:51, |
I think this issue happens when a project depends on a local swift package, and that local swift package depends on remote packages. In this case, if the generated project is opened, then Xcode resolves remote packages and create In conclusion, this issue is associated with resolving package dependencies in virtual environment such as Xcode Cloud. Am I right about this? @tdkn |
@woin2ee
No, to be precise, opening a workspace does not generate I don't fully understand the logic of @pepicrft |
@pepicrft But first, I'd like to ask: since it's good for newcomers, do you already have some ideas or directions for solving it? |
Thanks a lot @Udobnaja for your interest in contributing to this one :). I think @tdkn's suggestion makes total sense. We can adjust the logic of the mentioned function to return true, and make sure we have an acceptance test that covers the scenario to prevent regressions in the future. |
What happened?
If you use Local Package with Xcode's default integration mechanism, the .package.resolved file is not generated by Tuist, so builds will fail on Xcode Cloud, which expects the existence of a
*.xcworkspace/xcshareddata/swiftpm/Package.resolved
file.How do we reproduce it?
tuist generate --no-open
.package.resolved
file should be present but is missing.*.xcworkspace/xcshareddata/swiftpm/Package.resolved
should have been generated, but it's not there.Resolve package dependencies
task locally.Error log
Simulate Xcode Cloud's
Resolve package dependencies
task locally.The following error outputs:
macOS version
14.4.1
Tuist version
4.14.0
Xcode version
15.4
The text was updated successfully, but these errors were encountered: