bug: verify-binaries/verify.py incorrectly parses version string; gives error or downloads wrong files #30145

issue BenWestgate openend this issue on May 21, 2024
  1. BenWestgate commented at 11:28 am on May 21, 2024: contributor

    Current behaviour

    When I run: ./verify.py pub 27.0-x86_64-linux-gnu instead of downloading the version I told it, it downloads every version in the SHA256SUMS file starting with the first.

    The version_os and (also version_rc) are completely ignored which causes wrong files to download when an -rcN is intended.

    When I attempt to work around and give it a 1 dash string such as ./verify.py pub 27.0-x86_64 it will start with bitcoin-27.0-x86_64-apple-darwin which is not useful if I only needed bitcoin-27.0-x86_64-linux-gnu.

    Update: it will also parse "27.0-aarch64" wrong. Setting rc_version="aarch64" which causes no file found errors. But this is a valid string.

    Expected behaviour

    I expected it to only download bitcoin-27.0-x86_64-linux-gnu.tar.gz when I run ./verify.py pub 27.0-x86_64-linux-gnu. I expected rc_version to be set to the -rcN release candidate number as per the comments and documentation.

    Steps to reproduce

    Follow the instructions in the README.md

    If you only want to download the binaries for a certain platform, add the corresponding suffix, e.g.:

    But instead of the examples, give it a platform suffix with any dashes and it will ignore the requested platform. Or give “-aarch64” and aarch64 it will be interpreted as a release candidate number causing errors.

    Relevant log output

     0./verify.py pub 27.0-x86_64-linux-gnu
     1[INFO] got file https://bitcoincore.org/bin/bitcoin-core-27.0/SHA256SUMS.asc as SHA256SUMS.asc
     2[WARNING] https://bitcoin.org failed to provide file (https://bitcoin.org/bin/bitcoin-core-27.0/SHA256SUMS.asc). Continuing based solely upon https://bitcoincore.org.
     3[INFO] got file https://bitcoincore.org/bin/bitcoin-core-27.0/SHA256SUMS as SHA256SUMS
     4[WARNING] https://bitcoin.org failed to provide file (https://bitcoin.org/bin/bitcoin-core-27.0/SHA256SUMS). Continuing based solely upon https://bitcoincore.org.
     5[INFO] got 3 good signatures
     6[INFO] GOOD SIGNATURE (untrusted): SigData('1E4AED62986CD25D', 'Wladimir J. van der Laan <laanwj@protonmail.com>', trusted=False, status='')
     7[INFO] GOOD SIGNATURE (untrusted): SigData('17565732E08E5E41', 'Ava Chow <me@achow101.com>', trusted=False, status='')
     8[INFO] GOOD SIGNATURE (untrusted): SigData('3152347D07DA627C', 'Stephan Oeste (it) <it@oeste.de>', trusted=False, status='')
     9[WARNING] UNKNOWN SIGNATURE: SigData('410108112E7EA81F', 'hebasto@gmail.com', trusted=False, status='')
    10[WARNING] UNKNOWN SIGNATURE: SigData('C2371D91CB716EA7', 'sebastian.falbesoner@gmail.com', trusted=False, status='')
    11[WARNING] UNKNOWN SIGNATURE: SigData('E7E2984B6289C93A', 'pinheadmz@gmail.com', trusted=False, status='')
    12[WARNING] UNKNOWN SIGNATURE: SigData('2EEB9F5CC09526C1', 'fanquake@gmail.com', trusted=False, status='')
    13[WARNING] UNKNOWN SIGNATURE: SigData('F62711DBDCA8AE56', 'kvaciral@protonmail.com', trusted=False, status='')
    14[WARNING] UNKNOWN SIGNATURE: SigData('57FF9BDBCC301009', '', trusted=False, status='')
    15[WARNING] UNKNOWN SIGNATURE: SigData('8E4256593F177720', 'gugger@gmail.com', trusted=False, status='')
    16[INFO] removing *-unsigned binaries (bitcoin-27.0-arm64-apple-darwin-unsigned.tar.gz, bitcoin-27.0-arm64-apple-darwin-unsigned.zip, bitcoin-27.0-x86_64-apple-darwin-unsigned.tar.gz, bitcoin-27.0-x86_64-apple-darwin-unsigned.zip, bitcoin-27.0-win64-setup-unsigned.exe, bitcoin-27.0-win64-unsigned.tar.gz) from verification since https://bitcoincore.org does not host *-unsigned binaries
    17[INFO] removing *-debug binaries (bitcoin-27.0-aarch64-linux-gnu-debug.tar.gz, bitcoin-27.0-arm-linux-gnueabihf-debug.tar.gz, bitcoin-27.0-powerpc64-linux-gnu-debug.tar.gz, bitcoin-27.0-powerpc64le-linux-gnu-debug.tar.gz, bitcoin-27.0-riscv64-linux-gnu-debug.tar.gz, bitcoin-27.0-x86_64-linux-gnu-debug.tar.gz, bitcoin-27.0-win64-debug.zip) from verification since https://bitcoincore.org does not host *-debug binaries
    18[INFO] removing *-codesignatures binaries (bitcoin-27.0-codesignatures-27.0.tar.gz) from verification since https://bitcoincore.org does not host *-codesignatures binaries
    19[INFO] downloading bitcoin-27.0-aarch64-linux-gnu.tar.gz to /tmp/bitcoin_verify_binaries.27.0-x86_64-linux-gnu
    
    0amnesia@amnesia:~/.local/share/bitcoin-core$ ./verify.py pub 27.0-aarch64
    1[ERROR] couldn't fetch file (https://bitcoincore.org/bin/bitcoin-core-27.0/test.aarch64/SHA256SUMS.asc). Have you specified the version number in the following format?
    2<major>.<minor>[.<patch>][-rc[0-9]][-platform] (example: 22.0-x86_64 or 23.1-rc1-darwin)
    3wget output:
    4  --2024-05-21 12:28:08--  https://bitcoincore.org/bin/bitcoin-core-27.0/test.aarch64/SHA256SUMS.asc
    5  Resolving bitcoincore.org (bitcoincore.org)... 198.251.83.116
    6  Connecting to bitcoincore.org (bitcoincore.org)|198.251.83.116|:443... connected.
    7  HTTP request sent, awaiting response... 404 Not Found
    8  2024-05-21 12:28:14 ERROR 404: Not Found.
    

    How did you obtain Bitcoin Core

    git clone

    What version of Bitcoin Core are you using?

    master / 27.0

    Operating system and version

    Debian 12

    Machine specifications

    VM, 4GB RAM, virtIO SSD, wired

  2. BenWestgate commented at 11:28 am on May 21, 2024: contributor
    I would like to be assigned to this issue and will send a PR in an hour.
  3. BenWestgate referenced this in commit d6736dcd0f on May 21, 2024
  4. BenWestgate referenced this in commit 9f6ccfced9 on May 21, 2024
  5. BenWestgate renamed this:
    contrib/verify-binaries/verify.py incorrectly parses version strings with more than 2 dashes
    bug: verify-binaries/verify.py incorrectly parses version strings with more than 2 dashes
    on May 21, 2024
  6. BenWestgate renamed this:
    bug: verify-binaries/verify.py incorrectly parses version strings with more than 2 dashes
    bug: verify-binaries/verify.py incorrectly parses version strings causing error or wrong files to download
    on May 21, 2024
  7. BenWestgate renamed this:
    bug: verify-binaries/verify.py incorrectly parses version strings causing error or wrong files to download
    bug: verify-binaries/verify.py incorrectly parses version string; gives error or downloads wrong files
    on May 21, 2024
  8. willcl-ark added the label Scripts and tools on May 22, 2024
  9. BenWestgate referenced this in commit 752e7b335f on May 23, 2024
  10. BenWestgate referenced this in commit ff918f9e85 on May 23, 2024
  11. BenWestgate referenced this in commit 879ba55bcd on May 23, 2024
  12. BenWestgate referenced this in commit d5d4bf6b1a on May 23, 2024
  13. BenWestgate referenced this in commit 158ade0666 on May 23, 2024
  14. BenWestgate referenced this in commit 8135632c33 on May 23, 2024
  15. BenWestgate referenced this in commit 3a1d5f2dd9 on Jun 23, 2024
  16. BenWestgate referenced this in commit a2fc9ddee9 on Jun 23, 2024
  17. BenWestgate referenced this in commit 4a85b154d0 on Jun 25, 2024
  18. BenWestgate referenced this in commit 3ab2520190 on Jun 25, 2024
  19. fanquake closed this on Jun 26, 2024

  20. fanquake referenced this in commit 2cd7c6bd93 on Jun 26, 2024

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-21 15:12 UTC

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