depends: Use $(package)_file_name when downloading from the fallback #33580

pull achow101 wants to merge 1 commits into bitcoin:master from achow101:depends-fallback-name changing 1 files +1 −1
  1. achow101 commented at 8:26 pm on October 8, 2025: member

    The server hosting the fallbacks uses make download so the files are only available with their overridden names rather than the original name on the upstream source. We should therefore also use the overridden name when downloading from the fallback.

    Fixes https://github.com/bitcoin-core/bitcoincore.org/issues/1168

  2. depends: Use $(package)_file_name when downloading from the fallback 671b774d1b
  3. DrahtBot added the label Build system on Oct 8, 2025
  4. DrahtBot commented at 8:26 pm on October 8, 2025: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/33580.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK theuni, janb84, hebasto

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  5. theuni approved
  6. theuni commented at 8:39 pm on October 8, 2025: member

    utACK 671b774d1b58c491b53f2b2f6ee42fb6b65a0e71. I was going to PR the same change.

    For more context: Our sources server runs make download and makes those sources available as a backup host.

    We can’t control upstream filenames, so sometimes we rename them for local storage in depends. For ex “v0.1.tar.gz” may become “libfoo-v0.1.tar.gz”.

    But when we try to fetch “v0.1.tar.gz” from our backup, it doesn’t exist, because it’s been renamed to “libfoo-v0.1.tar.gz” there.

    So instead of requesting the original filename from our backup, request the renamed file. If there’s a hash mismatch, that’ll be detected later on, so there’s no loss of security.

  7. janb84 commented at 12:09 pm on October 9, 2025: contributor

    ut ACK 671b774d1b58c491b53f2b2f6ee42fb6b65a0e71

    PR changes the third argument of fetch_file_inner() in the fallback scenario. This change ensures that, in the fallback scenario, the “friendly filename” is used to download the file instead of the “filename.”

    The file contains only the download logic, and I haven’t been able to verify whether the “friendly filename” is constructed the same way for the upload to the fallback server.

    The code is somewhat confusing to read because of double use of $(4). Once as the fourth argument to fetch_file() and once as the fourth arguments to fetch_file_inner(). Where in the fallback scenario the fourth argument of fetch_file() is used as both the 3rd and 4th argument of fetch_file_inner()

    The 4th argument of fetch_file() is $($(1)_file_name) (line129) which is the “friendly filename name”

    But we can conclude that in the fallback scenario the “friendly file name” is also used to download from the fallback server.

  8. maflcko added the label DrahtBot Guix build requested on Oct 10, 2025
  9. luke-jr referenced this in commit d25f97ac37 on Oct 10, 2025
  10. DrahtBot commented at 4:37 am on October 11, 2025: contributor

    Guix builds (on x86_64) [untrusted test-only build, possibly unsafe, not for production use]

    File commit becf1500131805bd6a47486cd5bc5bdb55839211(master) commit 3bb424e4c9928ccb37620530253e3d6cba4cf3bf(pull/33580/merge)
    *-aarch64-linux-gnu-debug.tar.gz ce4c707a8290535c... 4a6defa5fab009e8...
    *-aarch64-linux-gnu.tar.gz 67b1f4734c192168... 854c5d3fe86efe86...
    *-arm-linux-gnueabihf-debug.tar.gz 6ac2456054747bbe... 4280344b687b82da...
    *-arm-linux-gnueabihf.tar.gz c9d34eb678434d01... 180d4df077e54d7e...
    *-arm64-apple-darwin-codesigning.tar.gz d203bf318c53c456... 12b26f2e8d28c18b...
    *-arm64-apple-darwin-unsigned.tar.gz d1cb0781e6b13493... 54b1f9939517fa3c...
    *-arm64-apple-darwin-unsigned.zip 1b589e49fcd84552... d7be0dc918374cc9...
    *-powerpc64-linux-gnu-debug.tar.gz f85eae61e1de60bc... b1e0ba77d34f8faf...
    *-powerpc64-linux-gnu.tar.gz 73bb93a8c447ebf9... 4a3d5463f25e20e4...
    *-riscv64-linux-gnu-debug.tar.gz 26c881f2d30b684d... 0a9c264091f95a83...
    *-riscv64-linux-gnu.tar.gz 02b07f007f4bdb40... 52ecd970eeee5ba1...
    *-x86_64-apple-darwin-codesigning.tar.gz 17b4f986f196d0c4... e594e470cc3d3a1c...
    *-x86_64-apple-darwin-unsigned.tar.gz 2f09fbd710bfcde5... dc7dcf3f5f96b1f2...
    *-x86_64-apple-darwin-unsigned.zip c97a014d7ae11621... 59f3c7cfac61e0b9...
    *-x86_64-linux-gnu-debug.tar.gz 30ff9bbd75a8f856... 0efa5a6160b72a51...
    *-x86_64-linux-gnu.tar.gz 77df5db6e4e92fbd... 2b680981a16a3269...
    *.tar.gz c428e6520d5b542d... f63a6d44f84f55ca...
    SHA256SUMS.part 0fa151c5c45a5780... a3e0dd4aff809f91...
    guix_build.log 6f47e3bc22a80251... 95ed3d1ddf951738...
    guix_build.log.diff 9cbfe03191b9290d...
  11. DrahtBot removed the label DrahtBot Guix build requested on Oct 11, 2025
  12. hebasto approved
  13. hebasto commented at 10:51 am on October 13, 2025: member

    ACK 671b774d1b58c491b53f2b2f6ee42fb6b65a0e71, tested with the following patch:

    0--- a/depends/packages/native_capnp.mk
    1+++ b/depends/packages/native_capnp.mk
    2@@ -1,6 +1,6 @@
    3 package=native_capnp
    4 $(package)_version=1.2.0
    5-$(package)_download_path=https://capnproto.org/
    6+$(package)_download_path=https://capnproto.org.FAIL/
    7 $(package)_download_file=capnproto-c++-$($(package)_version).tar.gz
    8 $(package)_file_name=capnproto-cxx-$($(package)_version).tar.gz
    9 $(package)_sha256_hash=ed00e44ecbbda5186bc78a41ba64a8dc4a861b5f8d4e822959b0144ae6fd42ef
    

    On the master branch:

     0$ gmake -C depends clean-all
     1$ gmake -C depends capnp_fetched
     2gmake: Entering directory '/home/hebasto/dev/bitcoin/depends'
     3Fetching capnproto-c++-1.2.0.tar.gz from https://capnproto.org.FAIL/
     4  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
     5                                 Dload  Upload   Total   Spent    Left  Speed
     6  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: capnproto.org.FAIL
     7Warning: Problem : timeout. Will retry in 1 seconds. 3 retries left.
     8  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: capnproto.org.FAIL
     9Warning: Problem : timeout. Will retry in 2 seconds. 2 retries left.
    10  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: capnproto.org.FAIL
    11Warning: Problem : timeout. Will retry in 4 seconds. 1 retries left.
    12  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: capnproto.org.FAIL
    13Fetching capnproto-c++-1.2.0.tar.gz from https://bitcoincore.org/depends-sources
    14  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
    15                                 Dload  Upload   Total   Spent    Left  Speed
    16  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
    17curl: (22) The requested URL returned error: 404
    18gmake: *** [funcs.mk:343: /home/hebasto/dev/bitcoin/depends/sources/download-stamps/.stamp_fetched-capnp-capnproto-cxx-1.2.0.tar.gz.hash] Error 22
    19gmake: Leaving directory '/home/hebasto/dev/bitcoin/depends'
    

    This PR:

     0$ gmake -C depends clean-all
     1$ gmake -C depends capnp_fetched
     2gmake: Entering directory '/home/hebasto/dev/bitcoin/depends'
     3Fetching capnproto-c++-1.2.0.tar.gz from https://capnproto.org.FAIL/
     4  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
     5                                 Dload  Upload   Total   Spent    Left  Speed
     6  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: capnproto.org.FAIL
     7Warning: Problem : timeout. Will retry in 1 seconds. 3 retries left.
     8  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: capnproto.org.FAIL
     9Warning: Problem : timeout. Will retry in 2 seconds. 2 retries left.
    10  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: capnproto.org.FAIL
    11Warning: Problem : timeout. Will retry in 4 seconds. 1 retries left.
    12  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: capnproto.org.FAIL
    13Fetching capnproto-cxx-1.2.0.tar.gz from https://bitcoincore.org/depends-sources
    14  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
    15                                 Dload  Upload   Total   Spent    Left  Speed
    16100 1727k  100 1727k    0     0   739k      0  0:00:02  0:00:02 --:--:--  739k
    17/home/hebasto/dev/bitcoin/depends/work/download/capnp-1.2.0/capnproto-cxx-1.2.0.tar.gz.temp: OK
    18gmake: Leaving directory '/home/hebasto/dev/bitcoin/depends'
    
  14. hebasto merged this on Oct 13, 2025
  15. hebasto closed this on Oct 13, 2025

  16. fanquake referenced this in commit 0b80204a37 on Oct 13, 2025
  17. fanquake commented at 3:00 pm on October 13, 2025: member
    Backported to 30.x in #33609.
  18. fanquake referenced this in commit f28317b6f0 on Oct 13, 2025

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: 2025-11-05 18:13 UTC

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