opam export: record vcs commit hash when a vcs url is specified#4055
opam export: record vcs commit hash when a vcs url is specified#4055rjbou merged 5 commits intoocaml:masterfrom
Conversation
|
Agree to integrate this sspecification, to be sure to rebuild the exact same switch. There is a side effect: I change pinned packages (and some from repo acceptiong allowing vcs urls): e;g if you pin a package to a branch, after an export & import this package will be pinned to an exact commit. There is a way to retrieve the commit branch (it's implemented in opam or a plugin), but we loose the information if first user wanted to pin to a commit or a branch. |
|
I rebased on top of master and added a commit which addresses the review comments. when merging #4040 (that now adds an optional labeled argument |
|
now that #4040 is merged, I rebased this on top of master - and by doing this I squashed all commits (which simplified the rebase). I also guarded, as discussed some weeks ago, this behaviour behind an optional labeled apart from this PR, only df3bd35 and 365ac02 are needed for orb. I can cherry-pick them on here if that is preferable. thanks for reviews, discussion, and merges :) |
|
I updated few things:
|
|
thanks @rjbou -- indeed this works fine for me. tested with: $ opam pin add orb https://github.com/hannesm/orb.git#active # this includes this branch and the two commits mentioned above on the opam side
$ opam repo add test-unikernels https://github.com/roburio/reproducible-unikernel-repo.git
$ orb orb build --twice --repo=test-unikernels,default unikernel-hello-hvtand then the resulting /tmp/bi-unikernel-hello*/*opam-switch contains ocamlgraph and unikernel-hello-hvt which are pinned to the respective git commits. |
* changes warnings into errors * use [Opamrepository.revision] to handle other VCSs * use [OpamFile.URL.with_url] to not recreate an url * fix source dir look up
this is useful for having an export file which can be imported and will contain the exact same sources (related to #4040), part of reproducibilty efforts