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

Question Regarding Swift Package Resolution on 1.18.0 #949

Open
rig-0 opened this issue Jan 28, 2025 · 5 comments
Open

Question Regarding Swift Package Resolution on 1.18.0 #949

rig-0 opened this issue Jan 28, 2025 · 5 comments

Comments

@rig-0
Copy link

rig-0 commented Jan 28, 2025

I'm encountering the following error when attempting to update to 1.18.0 and I'm not yet clear on whether this is an issue caused by 1.18.0 or whether this is a user error:

multiple similar targets 'IssueReporting', 'IssueReportingTestSupport', 'XCTestDynamicOverlay' appear in package 'swift-issue-reporting' and 'xctest-dynamic-overlay', this may indicate that the two packages are the same and can be de-duplicated by using mirrors. if they are not duplicate consider using the moduleAliases parameter in manifest to provide unique names

We have a rather complex project setup with many swift packages (many of which are self-managed dependencies), and so my workflow to resolve packages is the following:

  1. From root directory, call swift package update in terminal. This updates the root-level Package.resolved file.
  2. I copy this resolved file into /zzz.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved.

It's only after the second stop (copying over the resolved file) that Xcode throws the error. If I only update the root level resolved file, everything is fine.

Do you have any thoughts about how I can resolve this? In the meantime, I am staying on 1.17.7. Thanks for your help, and please let me know if you need any more information about my setup.

@stephencelis
Copy link
Member

@rig-0 Are you depending on swift-issue-reporting directly? Can you share your package file?

@rig-0
Copy link
Author

rig-0 commented Jan 28, 2025

So, I hope this is enough information to go off, but yes, in a way, we are depending on swift-issue-reporting directly, through an internally managed package.

The top section is a preview of our main app's swift package. It has a reference to our internally managed foundation package, as well as snapshot testing. The following section is a preview of our foundation package, which has dependencies on swift-issue-reporting as well as a the swift-tagged package.

name: "ZZZApp",
dependencies: [
	.package(url: "https://github.com/ZZZ/zzz-foundation", exact: .init(1, 0, 0)),
	.package(url: "https://github.com/pointfreeco/swift-snapshot-testing", from: .init(1, 14, 2)),
],
targets: [
	...
	.testTarget(
		name: "SnapshotTests",
		dependencies: [
			...
			.product(name: "SnapshotTesting", package: "swift-snapshot-testing", condition: .when(platforms: [.tvOS])),
		]
	),
]
name: "ZZZFoundation",
dependencies: [
	...
	.package(url: "https://github.com/pointfreeco/swift-issue-reporting", from: .init(1, 4, 0)),
],
targets: [
	...
	.target(
		name: "ZZZTarget",
		dependencies: [
			...
			.product(name: "IssueReporting", package: "swift-issue-reporting"),
		]
	),
]

@doozMen
Copy link
Contributor

doozMen commented Feb 6, 2025

I have a similar setup like @rig-0 and have the same issue. I also had this in the past. Have to revert the upste because of that!

@mbrandonw
Copy link
Member

I thought we had this documented, but currently you should not be depending on pointfreeco/swift-issue-reporting. You should be depending on: http://github.com/pointfreeco/xctest-dynamic-overlay

I know that is confusing, but unfortunately doesn't support redirects for repo renames, and so this is necessary until we can fully rename and archive the old repo.

@doozMen
Copy link
Contributor

doozMen commented Feb 7, 2025

Ok sorry I missed the docs on that will change the dependency. This indeed solved my issue. Thanks @mbrandonw and @stephencelis for the quick response and awesome package!

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

No branches or pull requests

4 participants