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

Record local sha? #699

Open
infotroph opened this issue Oct 3, 2024 · 2 comments
Open

Record local sha? #699

infotroph opened this issue Oct 3, 2024 · 2 comments
Labels
feature a feature request or enhancement

Comments

@infotroph
Copy link
Contributor

When the path to a local package is inside a version-controlled directory, would it be desirable in principle for pak to keep a record of its commit hash at install time?

When debugging dev packages I often want to know which commit I installed from, and have come to really appreciate how easy it is to get that from the RemoteSha field when a package was installed from GitHub or R-universe.

For packages installed locally this doesn't seem to be recorded, and from #621 (comment) I suspect that may be intentional. I agree with that comment that I don't want pak to make upgrade decisions based on the state of a local directory, but could the mentioned "we could add it and ... use for other things in the future" include providing a sha for runtime diagnostics?

(For context, I ask because I just hand-rolled a hash-recording step in the build script for one of my internal packages and thought "Well, that works, but this entire script ought to just be pak::local_install()" 😄 )

@gaborcsardi
Copy link
Member

It is not trivial to decide if a local directory has an up to date sha, we'd probably need to call git, which is not so great in itself, plus there are a lot of edge cases.

@infotroph
Copy link
Contributor Author

Thinking through the process, I think what I'm picturing here is (roughly equivalent to?) the ability to pass a local path to the git:: package source, which probably implies "that would mean implementing support for the Git local transport protocol." Definitely not a small change.

@gaborcsardi gaborcsardi added the feature a feature request or enhancement label Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants