Skip to content

Comments

Fix unstable hash when a dependency is resolved both via registry and scm#7518

Merged
fortmarek merged 1 commit intomainfrom
fix/duplicate-dependencies
Apr 23, 2025
Merged

Fix unstable hash when a dependency is resolved both via registry and scm#7518
fortmarek merged 1 commit intomainfrom
fix/duplicate-dependencies

Conversation

@fortmarek
Copy link
Member

Resolves #7515

Short description 📝

When a transitive dependency is referenced with the registry identifier in the Package.swift without the --replace-scm-with-registry flag being used, SwiftPM ends up resolving both the scm and registry variant of the dependency. Tuist then ends up "randomly" using one or the other.

This PR fixes the issue by preferring a registry dependency if available. However, we recommend using --replace-scm-with-registry as a dependency resolved twice with possibly different versions is rarely what you want.

How to test the changes locally 🧐

  • See the attached issue.

Contributor checklist ✅

  • The code has been linted using run mise run lint-fix
  • The change is tested via unit testing or acceptance testing, or both
  • The title of the PR is formulated in a way that is usable as a changelog entry
  • In case the PR introduces changes that affect users, the documentation has been updated

Reviewer checklist ✅

  • The code architecture and patterns are consistent with the rest of the codebase
  • Reviewer has checked that, if needed, the PR includes the label changelog:added, changelog:fixed, or changelog:changed, and the title is usable as a changelog entry

@tuist
Copy link

tuist bot commented Apr 22, 2025

🛠️ Tuist Run Report 🛠️

Tuist Tests 🧪

Command Status Cache hit rate Tests Skipped Ran Commit
test TuistApp -- CODE_SIGN_IDENTITY= CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO 94 % 1 1 0 5ca1fb211
test TuistAutomationAcceptanceTests 94 % 1 0 1 5ca1fb211
test TuistDependenciesAcceptanceTests 94 % 1 0 1 5ca1fb211
test TuistGeneratorAcceptanceTests 94 % 1 0 1 5ca1fb211
test TuistKitAcceptanceTests 94 % 1 0 1 5ca1fb211
test TuistUnitTests 94 % 23 23 0 5ca1fb211

@fortmarek fortmarek changed the title Fix unstable hash when a depenedency is resolved both via regsitry and scm Fix unstable hash when a depenedency is resolved both via registry and scm Apr 23, 2025
@fortmarek fortmarek changed the title Fix unstable hash when a depenedency is resolved both via registry and scm Fix unstable hash when a dependency is resolved both via registry and scm Apr 23, 2025
@fortmarek fortmarek merged commit 2540683 into main Apr 23, 2025
13 checks passed
@fortmarek fortmarek deleted the fix/duplicate-dependencies branch April 23, 2025 07:35
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.

Unstable binary cache hashes for swift-composable-architecture/xctest-dynamic-overlay when using registry

3 participants