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

V3 originHash should update more eagerly #7644

Open
pyrtsa opened this issue Jun 7, 2024 · 0 comments
Open

V3 originHash should update more eagerly #7644

pyrtsa opened this issue Jun 7, 2024 · 0 comments

Comments

@pyrtsa
Copy link

pyrtsa commented Jun 7, 2024

Description

The new v3 pin file format for Package.resolved introduced a new key originHash, which appears to be a SHA-256 checksum of local package files (often just shasum -a 256 Package.swift). The hash is recomputed whenever calling swift package update [...], however the new value is only written to disk when the dependency graph was changed as a result.

Often when editing the package file or when merging changes from branches which do so, the originHash value is left in a state not reflecting the merged result, and by surprise the pin file only changes at a later time.

I think it would be ideal if swift package update [...] made sure to update the originHash even if no package dependency got changed.

(It would also be nice if the package resolution automatic triggered by Xcode made sure to keep originHash up to date. I don't know which precise SwiftPM command it corresponds to; swift package resolve maybe? See related thread in Developer Forums.)

Expected behavior

No response

Actual behavior

No response

Steps to reproduce

No response

Swift Package Manager version/commit hash

No response

Swift & OS version (output of swift --version && uname -a)

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant