devrandom / gitian-builder

Build packages in a secure deterministic fashion inside a VM
https://gitian.org/
Other
402 stars 226 forks source link

Specifically fetch the requested commit #238

Closed dongcarl closed 3 years ago

dongcarl commented 3 years ago

Instead of fetching all tags and all heads, just fetch the requested commit. This accomplishes two things:

  1. Avoids overzealous fetching of unrelated objects from the repo
  2. Allows building commits which do not belong to any branch in a repository, such as merge commits generated by DrahtBot (example). Previously this was not possible.
maflcko commented 3 years ago

Interesting TIL that fetching by commit is possible. Though, it seems to only work with the full hash (not a truncated one)

MarkLTZ commented 3 years ago

After this commit, building of Bitcoin 0.19.1 does not work anymore. Did I miss some documentation update?

devrandom commented 3 years ago

@MarkLTZ what are the actual symptoms?

MarkLTZ commented 3 years ago
From https://github.com/bitcoin/bitcoin
 * tag                   v0.19.1     -> FETCH_HEAD
error: pathspec 'v0.19.1' did not match any file(s) known to git.
Traceback (most recent call last):
    3: from bin/gbuild:307:in `<main>'
    2: from bin/gbuild:307:in `each'
    1: from bin/gbuild:322:in `block in <main>'
bin/gbuild:23:in `system!': failed to run cd inputs/bitcoin && git checkout -q v0.19.1 (RuntimeError)

Using a cloned version of this repo with this commit rolled back everything work.

MarkLTZ commented 3 years ago

These are commands used to compile:

export NAME=Mark
export VERSION=0.19.1

./gitian-build.py --setup $NAME $VERSION

./gitian-build.py --build --os l --detach-sign --no-commit --jobs 4 $NAME $VERSION
devrandom commented 3 years ago

Thank you @MarkLTZ. Fixing in #239... and #240.