-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Issue integrating Github SCM Branch with Registry Package #7393
Comments
There's two options here I believe:
|
Appreciate the reply @bnbarham! I do agree option 1 is closest to what we want, however effectively we need to both change the source from a registry -> GitHub, but also to switch from a concrete registry tag (ex The use case is to support primarily using versioned registry packages where as-needed when working at an app level you have the flexibility to test changes to a dependency on a branch across the entire dependency graph. For comparison in a Cocoapods environment as long as the semver requirements of "FeaturePackage" podspec were met by the "RootProject" pod file (pointed to a branch) the dependency manager would resolve the dependency from the branch across all child frameworks. From memory of my earlier investigations into |
Sorry for the delay!
If you specify a local path it would use that instead, regardless of any version specified. Would that work for you here? It would require checking out all your repositories locally first, but is probably the best workaround we have right now. FWIW I don't think this issue is really about the package registry or not - you'd have the same problem if you just wanted to override a regular package URL with another version. So we could probably broaden this issue to track overriding in general. |
@jonnyklemmer Which tools version did you specify in the Package.swift files? |
Sorry for the delayed response but this was all with 5.9 |
@jonnyklemmer I'm wondering if #7912 is part of the problem in your case. |
Is it reproducible with SwiftPM command-line tools:
swift build
,swift test
,swift package
etc?Description
When setting up a project which consists of packages resolved via Swift Package Registry our desire is to also support temporary development via Github branches. The goal here being that tagged and shipped releases can utilize a semver versioned package via the registry, but developers working on local iterations of code could easily point to a branch of the repository. The following is the issues I have come across with our current approach, but if theres better/alternate ways to "solve" this workflow I'm all ears!
The following Package files illustrate the issue with a top level "root project" and a child "feature package" - who both share the same dependency "Pillars" (brought in via registries and SCM).
Sample Package Files
:Root Project - Package.swift
Child Feature - Package.swift
Expected behavior
Ideally the root project's package manifest would supersede the children and it would resolve the package via the github branch. The transitive dependency of the child feature package would therefore also be fulfilled by the github branch package.
Actual behavior
It seems given the two variations come from SCM & a Package Registry (and the Github repo last path component doesn't match the registry scope.name) that it is indeterministic which package is resolved.
Initially this was seen via this error:
Currently the
swift package resolve
command is now simply successful - but pulls in the package from the registry and ignores the branch specified by the root project manifest.Steps to reproduce
Configure a package with the attached package files, a 3rd "shared" dependency package (in this case "Pillars"), and host it both on github and a package registry.
Apologies this isn't fully available as an open-source reproduction environment given it utilizes private frameworks and an Artifactory package registry - if thats a blocker let me know and can work to provide easier reproduction.
Swift Package Manager version/commit hash
Swift Package Manager - Swift 5.9.0
Swift & OS version (output of
swift --version ; uname -a
)swift-driver version: 1.87.3 Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5)
Target: arm64-apple-macosx14.0
Darwin [redacted] 23.3.0 Darwin Kernel Version 23.3.0: Wed Dec 20 21:30:44 PST 2023; root:xnu-10002.81.5~7/RELEASE_ARM64_T6000 arm64u
The text was updated successfully, but these errors were encountered: