script: Fix gitian-build.py –pull option #18336

pull hebasto wants to merge 3 commits into bitcoin:master from hebasto:20200312-gitian-build-pull changing 1 files +19 −10
  1. hebasto commented at 6:05 pm on March 12, 2020: member

    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.

  2. script: Clone inputs/bitcoin repository explicitly 1f4198b3fb
  3. fanquake added the label Scripts and tools on Mar 12, 2020
  4. hebasto force-pushed on Mar 14, 2020
  5. hebasto commented at 4:53 am on March 14, 2020: member
    Updated 974ad22534968385a5d0c0e319f98463de627533 -> 7517a2ce303e925d5bdc8cdef3d688ac9596a7c6 (pr18336.01 -> pr18336.02, compare): bug fix.
  6. script: Use --url option in 'git fetch' command 55eaeda9f1
  7. script: Fix gitian-build.py --pull option
    This change checks workdir/bitcoin repository out to the top commit of
    the pull request, and makes usage of gitian descriptors consistent.
    437ff9a416
  8. hebasto force-pushed on Mar 15, 2020
  9. hebasto commented at 7:01 pm on March 15, 2020: member

    Updated 7517a2ce303e925d5bdc8cdef3d688ac9596a7c6 -> 437ff9a416b0d12d0c57b92e143b34e22f840078 (pr18336.02 -> pr18336.03, diff):

    • restructured commits to make the fix of --url bug more obvious
  10. hebasto commented at 7:18 pm on May 26, 2021: member

    From #bitcoin-core-builds IRC channel:

    18:38:35 <achow101> time to write a replacement to gitian-build.py

  11. hebasto closed this on May 26, 2021

  12. hebasto deleted the branch on Sep 2, 2021
  13. DrahtBot locked this on Sep 2, 2022


hebasto

Labels
Scripts and tools


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-18 21:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me