During testing #18331 I’ve encountered with three bugs of the gitian-build.py
script.
The first one:
0$ git clone https://github.com/bitcoin/bitcoin.git
1$ cp ./bitcoin/contrib/gitian-build.py .
2$ ./gitian-build.py --setup
3$ ./gitian-build.py --pull --build --os w --detach-sign hebasto 18331
4remote: Enumerating objects: 19, done.
5remote: Counting objects: 100% (19/19), done.
6remote: Total 27 (delta 19), reused 19 (delta 19), pack-reused 8
7Unpacking objects: 100% (27/27), 6.77 KiB | 315.00 KiB/s, done.
8From https://github.com/bitcoin/bitcoin
9 * branch refs/pull/18331/merge -> FETCH_HEAD
10Traceback (most recent call last):
11 File "./gitian-build.py", line 262, in <module>
12 main()
13 File "./gitian-build.py", line 236, in main
14 os.chdir('../gitian-builder/inputs/bitcoin')
15FileNotFoundError: [Errno 2] No such file or directory: '../gitian-builder/inputs/bitcoin'
i.e., gitian-builder/inputs/bitcoin
repository is not initialized at all if the first --build
command comes with --pull
option.
The second bug:
0...
1$ ./gitian-build.py --pull --build --os w --detach-sign hebasto 18331
2$ cd bitcoin
3$ git log -1 --oneline
4e2d36639c (HEAD -> master, origin/master, origin/HEAD) Merge [#18228](/bitcoin-bitcoin/18228/): test: Add missing syncwithvalidationinterfacequeue
5$ cd ../gitian-builder/inputs/bitcoin/
6$ git log -1 --oneline
757da42921 (HEAD) Merge f05f8a49e02b49b6bcbdb82681b4c67509e8db73 into e2d36639ca87b980b147047e4e47cf160b2c9406
i.e., gitian descriptors, which were passed to gbuild
, are from the wrong commit.
The third bug:
https://github.com/bitcoin/bitcoin/blob/d402c1e4d3e812341176e0948d64ff126f9ec3c1/contrib/gitian-build.py#L241
i.e., --url
option is ignored here.
This PR fixes all described bugs.
UPDATE. This PR was also used during #21036 testing.