BlockstreamResearch / rust-simplicity

Creative Commons Zero v1.0 Universal
58 stars 12 forks source link

Update jets script #203

Closed uncomputable closed 9 months ago

uncomputable commented 9 months ago

Update the update jets script to handle wrapped jets.

Simplify the update jets script to use the currently checked-out version of libsimplicity instead of fiddling with git checkout. This might be controversial? The change makes my life easier. It might also break existing CI.

apoelstra commented 9 months ago

For sure, we shouldn't be running git checkout in peoples' repos like this. Probably removing that logic is an improvement in that it doesn't unexpectedly clobber stuff.

But I think you should preserve the warning. Rather than doing git checkout "$REV" just check what the checked-out rev is with REV=$(git rev-parse HEAD) and compare that to VENDORED_HEAD.

(And we should also check whether the repo is dirty, if there's a straightforward way to do that.

https://stackoverflow.com/questions/2657935/checking-for-a-dirty-index-or-untracked-files-with-git

suggests we can use test -n "$(git status --porcelain)" which will basically check whether git status runs clean.)

apoelstra commented 9 months ago

1ef3ffc1fa1ad9c51f0767c79f0d0890fa599efd looks good other than that. I haven't tested locally; I suspect the new file will require a bit of tweaking to my local scripts.

uncomputable commented 9 months ago

I added warnings about different libsimplicity versions and an unclean libsimplicity repo. The checks seem to work after a quick testing.