Commit Graph

10 Commits

Author SHA1 Message Date
Yueh-Shun Li
0b271455ec tests.fetchurl: add showURLs-urls-mirrors 2025-12-19 22:44:22 +08:00
Yueh-Shun Li
d8ac71ce95 tests.fetchurl: add urls-mirrors 2025-12-19 22:44:21 +08:00
Yueh-Shun Li
7c4673bbb8 tests.fetchurl: add urls-simple 2025-12-18 17:01:39 +08:00
Yueh-Shun Li
d0f0e55689 tests.fetchurl: add test flag-appending-netrcPhase-curlOptsList 2025-12-18 06:12:03 +08:00
Yueh-Shun Li
dd7414ba7f tests.fetchurl: add flag-appending tests 2025-12-18 06:10:43 +08:00
Silvan Mosberger
56f680d915 fetchurl: Allow hashed mirror overriding with config.hashedMirrors
Allows having alternate hashed mirrors as fallbacks. Useful in case the
default hashed mirror is not accessible or doesn't have everything
needed.

Co-authored-by: Johan Herland <johan.herland@tweag.io>
Co-authored-by: Yuriy Taraday <yuriy.taraday@tweag.io>
Co-authored-by: Alexander Bantyev <balsoft@balsoft.ru>
2025-10-06 14:15:10 +02:00
Alexander Bantyev
27a36aeb9c fetchurl: fix hashedMirrors with downloadToTemp
fetchurl supports postFetch, which must not run when fetching from
hashedMirrors, because they provide pre-built derivation outputs.

fetchurl also supports downloadToTemp, which modifies behavior relating
to postFetch.

Before this commit, a call like

    fetchurl {
      url = "...";
      downloadToTemp = true;
      postFetch = ''
        mv "$downloadedFile" "$out"
      '';
    }

would work in normal scenarios, but fail when fetching from
hashedMirrors, due to how internally downloadToTemp was not tied to
postFetch as closely as it should've been. This resulted in an error
like

    builder [...] failed to produce output path

This commit fixes this, making hashedMirror fetching work even for
derivations that have downloadToTemp enabled.

Co-Authored-By: Silvan Mosberger <silvan.mosberger@tweag.io>
2025-09-29 23:46:44 +02:00
Anderson Torres
ce21e97a1f fetchurl: nixfmt-rfc-style 2024-09-25 14:51:53 -03:00
Artturin
3452cd8316 tests.fetchurl: remove alias usage 2022-11-24 22:32:34 +02:00
Silvan Mosberger
588439e131 fetchurl: Add curlOptsList test 2022-06-30 19:49:54 +02:00