Closed AngerM closed 11 months ago
Thanks a lot for the report. This is indeed a serious issue.
Cargo.lock has been a troublemaker for quite some time now, because of my trying to stay compatible with previous Rust versions (so can't update it, otherwise new libraries that liberally change their MSRV break mine). But then sniprun's own version inside cargo.lock doesn't change anymore !!
I think my solution is to not check-in Cargo.lock, what do you think about it?
Hopefully, users that use sh install.sh
(no argument -> download, instead of compiling locally) shouldn't be affected
I'll push an updated cargo.lock in the meantime, this should fix your immediate issue, please confirm
In general, I think the "right" thing to do is push the updated Cargo.lock file, but I'm not super familiar with the Rust Ecosystem.
https://doc.rust-lang.org/cargo/faq.html#why-do-binaries-have-cargolock-in-version-control-but-not-libraries https://users.rust-lang.org/t/how-to-distribute-rust-binaries/78400
As a general rule of thumb, yes
I wonder if I can just update sniprun's version in cargo.lock without updating other libs (potentially breaking my MSRV)... turns out that yes!
cargo update --offline
could you check your issue is gone ? I should have pushed a new commit to master
$ git reset --hard HEAD
$ git pull origin master
$ ./install.sh
$ git status
HEAD detached from 3b31770
Untracked files:
(use "git add <file>..." to include in what will be committed)
doc/tags
nothing added to commit but untracked files present (use "git add" to track)
looks like it!
hmmm this wouldn't reproduce the original issue I think
But nevermind, I was able to test on my machine and ... people in your case (those who updated between 1.3.7's release and now) will still have the problem, and there's nothing I can do, sadly :-/ Hopefully there ain't many of them
@AngerM thanks for the feedback, it's really worth a lot!
PS: if you're on MacOS, you shouldn't ./install.sh
since this will download the github-action-built binary that won't work. install.sh 1
or cargo build --release
instead.
I will keep this issue open a while so folks can find the solution: either
git reset --hard
@michaelb Thanks for the note.
It looks like the latest release on github is still v1.3.7 which is affected with this issue.
I use lazy and only download the latest release (not the latest main branch).
Would you kindly release a new version that contains your fix (I suppose https://github.com/michaelb/sniprun/commit/1c152ee5d883db7233e3891012bc4f0f9437a82b ?)
Oh, you're right I forgot (or lazily dismissed) the fact that not everyone pulls the latest master and some may have fixed a tag/commit in their package manager.
The next release is already scheduled for the coming days, thankfully
@pysan3 a new version (v1.3.8) just got released ! I'll close this issue some time from now, assuming no activity means no complaints !
Describe the bug The updated releases contain an un-updated
Cargo.lock
file. This means when you do thesh install.sh
orcargo build -r
theCargo.lock
file is modified, which prevents futuregit pull
's from succeeding with an error like:To Reproduce Steps to reproduce the behavior:
git pull
failsExpected behavior The
Cargo.lock
file should be up to date, socargo build -r
does not modify itScreenshots If applicable, add screenshots to help explain your problem.
Environment:
Additional context The sniprun folder after installing the latest 1.3.7 update and doing the install: