345 Commits

Author SHA1 Message Date
sempiternal-aurora 8f12d45a14 gcc: revise mirror list
Add an extra one from https://gcc.gnu.org/mirrors.html, and comment out
old ones that don't seem to be keeping up with current releases
2026-07-15 16:29:38 +12:00
Emily 035141be98 Revert "gcc: fix download issue for new release"
This reverts commit a237f34fe7.
2026-06-26 10:12:41 +01:00
Philip Taron eb7592ed12 gcc15: 15.2.0 -> 15.3.0 (#532074) 2026-06-18 00:02:21 +00:00
Dmitry Kalinkin 88c94c9bb3 texlive: add historic TeX mirrors to mirrors.nix (#518480) 2026-06-17 14:51:52 +00:00
liberodark a237f34fe7 gcc: fix download issue for new release 2026-06-17 08:24:33 +02:00
Eman Resu 917bf80632 fetchurl: avoid creating nativeBuildInputs list on every call 2026-06-01 23:18:12 -04:00
Eman Resu 4645f84f9d fetchurl: avoid resolvedUrl thunk 2026-06-01 23:18:11 -04:00
Eman Resu 14848d5db5 fetchurl/boot: use head foo instead of elemAt foo 0 2026-06-01 23:18:11 -04:00
Eman Resu 3d6d604a74 fetchurl/boot: inherit builtins to global scope 2026-06-01 23:18:10 -04:00
Eman Resu 62972398d8 fetchurl: avoid rewriteURL logic if it's null 2026-06-01 23:18:10 -04:00
Eman Resu 87163d15c7 fetchurl: inherit lib functions to global scope 2026-06-01 23:18:07 -04:00
Eman Resu b4a2e8626b fetchurl: avoid escaping hash 2026-06-01 23:15:30 -04:00
Eman Resu 28e6e36fa0 build-support/fetchurl: remove warnIf usage
warnIf sends our warning message through a function call, even if the
warning condition doesn't trigger. This requires a lot of thunk
allocation that can be easily avoided.
2026-05-28 00:19:37 -04:00
Eman Resu a350fc4a03 fetchurl: use concatMap rather than filtering and mapping 2026-05-11 16:11:01 -04:00
Vincenzo Mantova 77456b8349 fetchurl: add TeX historic archive mirrors 2026-05-09 20:06:06 +01:00
Ming-Chuan 23dc2d1a97 fetchurl/mirrors: remove funet.fi from KDE mirror list
It serves incorrect krita 5.2.14 source archive
2026-02-22 04:38:33 +08:00
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 fc180191de fetchurl: builder.sh: handle urls as a Bash array
Clean up leftover for commit cd13136f03
("fetchurl: use __structuredAttrs = true and pass curlOptsList directly")

Continue the work of commit 23236b331d
("fetchurl: fix handling of fallback URLs"),
addressing a Bash array re-assignment quirk:
when assigning a Bash array variable as if it were a plain variable,
the value goes to the first element,
and the rest of the array stays the same.

```console
$ foo=(a b)
$ declare -p foo
declare -a foo=([0]="a" [1]="b")
$ foo="c d"
$ declare -p foo
declare -a foo=([0]="c d" [1]="b")
```

Don't rewrite the `${urls[@]}` with resolved URLs,
but hold them with `${resolvedUrls[@]}` instead.

Co-authored-by: Matt Sturgeon <matt@sturgeon.me.uk>
Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-19 22:44:12 +08:00
Matt Sturgeon 1e5ca4eadb fetchurl: add doc-comment for fetchurl.resolveUrl 2025-12-18 21:00:38 +08:00
Yueh-Shun Li ca050c53b2 fetchurl: provide fetchurl.resolveUrl 2025-12-18 17:01:40 +08:00
Yueh-Shun Li 7c4673bbb8 tests.fetchurl: add urls-simple 2025-12-18 17:01:39 +08:00
Yueh-Shun Li 270ee9e19b fetchurl: mirrorList: simplify expression
Co-authored-by: Matt Sturgeon <matt@sturgeon.me.uk>
2025-12-18 17:01:31 +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
Yueh-Shun Li 04419e1b96 fetchurl: builder.sh: simplify curlOpts/curlOptsList appending 2025-12-18 02:53:23 +08:00
Yueh-Shun Li b9f1e058ae fetchurl: builder.sh: convert curlOpts to string if array encountered
Co-authored-by: Matt Sturgeon <matt@sturgeon.me.uk>
2025-12-18 02:52:48 +08:00
Yueh-Shun Li 915b484681 fetchurl: move netrcPhase invokation into build.sh
Don't rely on the `postPhase` in `$stdenv/setup.sh` provided by
`stdenv/generic/make-derivation.nix`'s realBuilder hack.
2025-12-17 20:43:01 +08:00
Yueh-Shun Li 5cbd4c3667 Revert "fetchurl, fetchgitlab: fix curlOpts extension" (#470831) 2025-12-15 18:22:29 +00:00
Yueh-Shun Li 58366ffe0c Revert "fetchurl, fetchgitlab: fix curlOpts extension" 2025-12-15 01:03:34 +08:00
Sergei Trofimovich 23236b331d fetchurl: fix handling of fallback URLs
Without the change fallback to `urls = []` does not
work as `$urls` evaluates on ony first entry. Use
`${urls[@]}` instead.

Example derivation that is fixed in `master` is
`xterm.src`:

Before:

    $ nix build --no-link -f. xterm.src --rebuild -L
    xterm> structuredAttrs is enabled
    ...
    xterm> trying ftp://ftp.invisible-island.net/xterm/xterm-403.tgz
    ...
    xterm> curl: (67) Access denied: 550
    xterm> error: cannot download xterm-403.tgz from any mirror

After:

    $ nix build --no-link -f. xterm.src --rebuild -L
    xterm> structuredAttrs is enabled
    ...
    xterm> trying ftp://ftp.invisible-island.net/xterm/xterm-403.tgz
    ...
    xterm> curl: (67) Access denied: 550
    ...
    xterm> trying https://invisible-mirror.net/archives/xterm/xterm-403.tgz
    xterm>   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
    xterm>                                  Dload  Upload   Total   Spent    Left  Speed
    xterm> 100  1577k 100  1577k   0     0 703670     0   0:00:02  0:00:02 --:--:-- 703866
2025-12-14 07:22:20 +00:00
Matt Sturgeon 55172e9583 fetchurl, fetchgitlab: fix curlOpts extension (#470550) 2025-12-13 22:16:44 +00:00
Nicolas Benes 3db11767a9 fetchurl, fetchgitlab: fix curlOpts extension
PR #464475 enables __structuredAttrs and makes curlOpts a bash array.
Consequently, it must be extended as such to be effective.

See also https://github.com/NixOS/nixpkgs/pull/464475#issuecomment-3649765507
2025-12-13 22:47:01 +01:00
Yueh-Shun Li 303ef6a5c9 fetchurl: pass SSL_CERT_FILE as environment variable via env 2025-12-14 01:30:39 +08:00
Yueh-Shun Li 689380e029 fetchurl, fetchgit: use __structuredAttrs = true and pass curlOptsList and sparseCheckout as lists (#464475) 2025-12-11 18:25:29 +00:00
Yueh-Shun Li ae800ea500 fetchurl: reference outputHash from finalAttrs.hash 2025-12-10 01:02:47 +08:00
Yueh-Shun Li cf99863262 fetchurl: reference lib.fakeHash for empty hash algorithm 2025-12-10 01:02:47 +08:00
Yueh-Shun Li cd13136f03 fetchurl: use __structuredAttrs = true and pass curlOptsList directly 2025-12-09 12:34:45 +08:00
Yueh-Shun Li 4535777468 fetchurl: sort inherited variables 2025-12-09 12:34:45 +08:00
Philip Taron 49af83567b fetchurl: make pname and version overridable via <pkg>.overrideAttrs (#458183) 2025-11-05 16:23:24 +00:00
Yueh-Shun Li 7e212bfdd5 fetchurl: fix pname and version overriding 2025-11-04 15:11:29 +08:00
Yueh-Shun Li 4ab091862a fetchurl: take derivationArgs 2025-11-03 21:31:02 +08:00
Yueh-Shun Li 1ec0227cc0 fetchurl: don't treat empty-string name special 2025-10-28 06:43:13 +08:00
Yueh-Shun Li aeddd850c6 fetchurl, fetchzip, fetchgit: format Nix expression after lib.extendMkDerivation 2025-10-28 06:41:42 +08:00
Yueh-Shun Li bf3e7097f3 fetchurl: restructure with lib.extendMkDerivation (not formatted) 2025-10-28 06:38:45 +08:00
Yueh-Shun Li 089fab12e3 fetchurl: move curlOpts warnings down to its value 2025-10-28 06:38:45 +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
Rebecca Turner 3d4fb2c3e6 fetchurl: Add missing arg to toPretty invocation
Thanks to @emilazy for the report:
https://github.com/NixOS/nixpkgs/pull/393136#issuecomment-3268711663

Fixes this crash:

```
… from call site
  at /Users/emily/Developer/nixpkgs/pkgs/build-support/fetchurl/default.nix:194:70:
   193|     else
   194|       throw "fetchurl requires a hash for fixed-output derivation: ${lib.generators.toPretty urls_}";
      |                                                                      ^
   195|

… while evaluating the value passed for the lambda argument
  at /Users/emily/Developer/nixpkgs/lib/generators.nix:524:5:
   523|   toPretty =
   524|     {
      |     ^
   525|       allowPrettyValues ? false,

error: expected a set but found a list: [ "https://cmake.org/files/v4.1/cmake-4.1.1.tar.gz" ]
```

It'll still crash, but with a nicer error message!
2025-09-09 10:06:26 -07:00
nixpkgs-ci[bot] f17dc1e31b Merge staging-next into staging 2025-08-05 18:07:00 +00:00