Skip to content

fetchurl: reference most attributes from finalAttrs and make them overridable with <pkg>.overrideAttrs#464474

Open
ShamrockLee wants to merge 6 commits intoNixOS:masterfrom
ShamrockLee:fetchurl-overriding
Open

fetchurl: reference most attributes from finalAttrs and make them overridable with <pkg>.overrideAttrs#464474
ShamrockLee wants to merge 6 commits intoNixOS:masterfrom
ShamrockLee:fetchurl-overriding

Conversation

@ShamrockLee
Copy link
Contributor

@ShamrockLee ShamrockLee commented Nov 24, 2025

This PR fixes the <pkg>.overrideAttrs overriding of most fetchurl arguments, and make them available from finalAttrs.

The exceptions are

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 6.topic: fetch Fetchers (e.g. fetchgit, fetchsvn, ...) labels Nov 24, 2025
@ShamrockLee ShamrockLee force-pushed the fetchurl-overriding branch 2 times, most recently from f9c7765 to 005b802 Compare November 24, 2025 06:38
@ShamrockLee ShamrockLee marked this pull request as ready for review December 9, 2025 18:33
@nixpkgs-ci nixpkgs-ci bot requested a review from philiptaron December 9, 2025 18:37
@ShamrockLee
Copy link
Contributor Author

nixpkgs-review result

Generated using nixpkgs-review-gha

Command: nixpkgs-review pr 464474
Commit: ec38a43e020b3e1052831c8f362c1ef24d66a354 (subsequent changes)
Merge: e537d305f2577f9487c08404089c4c8f63674951

Logs: https://github.com/ShamrockLee/nixpkgs-review-gha/actions/runs/20074739070


x86_64-linux

❌ 1 package failed to build:
  • tests.fetchurl.header
✅ 56 packages built:
  • tests.fetchDebianPatch.libPackage
  • tests.fetchDebianPatch.simple
  • tests.fetchFirefoxAddon.simple (tests.fetchFirefoxAddon.overridden-source)
  • tests.fetchFromBitbucket.withEncodedWhitespace
  • tests.fetchFromBitbucket.withEncodedWhitespaceGit
  • tests.fetchFromBitbucket.withoutWhitespace
  • tests.fetchFromGitHub.dumb-http-signed-tag
  • tests.fetchFromGitHub.fetchTags
  • tests.fetchFromGitHub.leave-git
  • tests.fetchFromGitHub.rootDir
  • tests.fetchFromGitHub.simple
  • tests.fetchFromGitHub.sparseCheckout
  • tests.fetchFromGitHub.sparseCheckoutNonConeMode
  • tests.fetchFromGitHub.submodule-deep
  • tests.fetchFromGitHub.submodule-leave-git
  • tests.fetchFromGitHub.submodule-leave-git-deep
  • tests.fetchFromGitHub.submodule-simple
  • tests.fetchNextcloudApp.simple-sha256
  • tests.fetchNextcloudApp.simple-sha512
  • tests.fetchPypiLegacy.fetchSimple
  • tests.fetchgit.dumb-http-signed-tag
  • tests.fetchgit.fetchTags
  • tests.fetchgit.leave-git
  • tests.fetchgit.prefetch-git-no-add-path
  • tests.fetchgit.rootDir
  • tests.fetchgit.simple
  • tests.fetchgit.sparseCheckout
  • tests.fetchgit.sparseCheckoutNonConeMode
  • tests.fetchgit.submodule-deep
  • tests.fetchgit.submodule-leave-git
  • tests.fetchgit.submodule-leave-git-deep
  • tests.fetchgit.submodule-simple
  • tests.fetchgit.withGitConfig
  • tests.fetchpatch.decode
  • tests.fetchpatch.fileWithApostrophe
  • tests.fetchpatch.fileWithSpace
  • tests.fetchpatch.full
  • tests.fetchpatch.hunks
  • tests.fetchpatch.relative
  • tests.fetchpatch.simple
  • tests.fetchpatch2.decode
  • tests.fetchpatch2.fileWithApostrophe
  • tests.fetchpatch2.fileWithSpace
  • tests.fetchpatch2.full
  • tests.fetchpatch2.hunks
  • tests.fetchpatch2.relative
  • tests.fetchpatch2.simple
  • tests.fetchurl.hashedMirrors
  • tests.fetchurl.no-skipPostFetch
  • tests.fetchzip.hiddenDir
  • tests.fetchzip.postFetch
  • tests.fetchzip.simple
  • tests.haskell.cabalSdist.assumptionLocalHasDirectReference
  • tests.haskell.cabalSdist.localHasNoDirectReference
  • tests.testers.runCommand.bork
  • tests.testers.runCommand.dns-resolution

Error logs: `x86_64-linux`
tests.fetchurl.header
  0     0   0     0   0     0     0     0  --:--:-- --:--:-- --:--:--     0
  0     0   0     0   0     0     0     0  --:--:-- --:--:-- --:--:--     0
curl: (22) SSL certificate OpenSSL verify result: unable to get local issuer certificate (20)
Warning: Problem : HTTP error. Will retry in 1 second. 3 retries left.

0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (22) The requested URL returned error: 503
Warning: Problem : HTTP error. Will retry in 2 seconds. 2 retries left.

0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (22) The requested URL returned error: 503
Warning: Problem : HTTP error. Will retry in 4 seconds. 1 retry left.

0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (22) The requested URL returned error: 503
error: cannot download source-salted-4k6rhs5qi451 from any mirror


aarch64-linux

✅ 57 packages built:
  • tests.fetchDebianPatch.libPackage
  • tests.fetchDebianPatch.simple
  • tests.fetchFirefoxAddon.simple (tests.fetchFirefoxAddon.overridden-source)
  • tests.fetchFromBitbucket.withEncodedWhitespace
  • tests.fetchFromBitbucket.withEncodedWhitespaceGit
  • tests.fetchFromBitbucket.withoutWhitespace
  • tests.fetchFromGitHub.dumb-http-signed-tag
  • tests.fetchFromGitHub.fetchTags
  • tests.fetchFromGitHub.leave-git
  • tests.fetchFromGitHub.rootDir
  • tests.fetchFromGitHub.simple
  • tests.fetchFromGitHub.sparseCheckout
  • tests.fetchFromGitHub.sparseCheckoutNonConeMode
  • tests.fetchFromGitHub.submodule-deep
  • tests.fetchFromGitHub.submodule-leave-git
  • tests.fetchFromGitHub.submodule-leave-git-deep
  • tests.fetchFromGitHub.submodule-simple
  • tests.fetchNextcloudApp.simple-sha256
  • tests.fetchNextcloudApp.simple-sha512
  • tests.fetchPypiLegacy.fetchSimple
  • tests.fetchgit.dumb-http-signed-tag
  • tests.fetchgit.fetchTags
  • tests.fetchgit.leave-git
  • tests.fetchgit.prefetch-git-no-add-path
  • tests.fetchgit.rootDir
  • tests.fetchgit.simple
  • tests.fetchgit.sparseCheckout
  • tests.fetchgit.sparseCheckoutNonConeMode
  • tests.fetchgit.submodule-deep
  • tests.fetchgit.submodule-leave-git
  • tests.fetchgit.submodule-leave-git-deep
  • tests.fetchgit.submodule-simple
  • tests.fetchgit.withGitConfig
  • tests.fetchpatch.decode
  • tests.fetchpatch.fileWithApostrophe
  • tests.fetchpatch.fileWithSpace
  • tests.fetchpatch.full
  • tests.fetchpatch.hunks
  • tests.fetchpatch.relative
  • tests.fetchpatch.simple
  • tests.fetchpatch2.decode
  • tests.fetchpatch2.fileWithApostrophe
  • tests.fetchpatch2.fileWithSpace
  • tests.fetchpatch2.full
  • tests.fetchpatch2.hunks
  • tests.fetchpatch2.relative
  • tests.fetchpatch2.simple
  • tests.fetchurl.hashedMirrors
  • tests.fetchurl.header
  • tests.fetchurl.no-skipPostFetch
  • tests.fetchzip.hiddenDir
  • tests.fetchzip.postFetch
  • tests.fetchzip.simple
  • tests.haskell.cabalSdist.assumptionLocalHasDirectReference
  • tests.haskell.cabalSdist.localHasNoDirectReference
  • tests.testers.runCommand.bork
  • tests.testers.runCommand.dns-resolution

x86_64-darwin (sandbox = relaxed)

❌ 2 packages failed to build:
  • tests.fetchurl.header
  • tests.testers.runCommand.bork
✅ 56 packages built:
  • tests.fetchDebianPatch.libPackage
  • tests.fetchDebianPatch.simple
  • tests.fetchFirefoxAddon.simple (tests.fetchFirefoxAddon.overridden-source)
  • tests.fetchFromBitbucket.withEncodedWhitespace
  • tests.fetchFromBitbucket.withEncodedWhitespaceGit
  • tests.fetchFromBitbucket.withoutWhitespace
  • tests.fetchFromGitHub.dumb-http-signed-tag
  • tests.fetchFromGitHub.fetchTags
  • tests.fetchFromGitHub.leave-git
  • tests.fetchFromGitHub.rootDir
  • tests.fetchFromGitHub.simple
  • tests.fetchFromGitHub.sparseCheckout
  • tests.fetchFromGitHub.sparseCheckoutNonConeMode
  • tests.fetchFromGitHub.submodule-deep
  • tests.fetchFromGitHub.submodule-leave-git
  • tests.fetchFromGitHub.submodule-leave-git-deep
  • tests.fetchFromGitHub.submodule-simple
  • tests.fetchNextcloudApp.simple-sha256
  • tests.fetchNextcloudApp.simple-sha512
  • tests.fetchPypiLegacy.fetchSimple
  • tests.fetchgit.dumb-http-signed-tag
  • tests.fetchgit.fetchTags
  • tests.fetchgit.leave-git
  • tests.fetchgit.prefetch-git-no-add-path
  • tests.fetchgit.rootDir
  • tests.fetchgit.simple
  • tests.fetchgit.sparseCheckout
  • tests.fetchgit.sparseCheckoutNonConeMode
  • tests.fetchgit.submodule-deep
  • tests.fetchgit.submodule-leave-git
  • tests.fetchgit.submodule-leave-git-deep
  • tests.fetchgit.submodule-simple
  • tests.fetchgit.withGitConfig
  • tests.fetchpatch.decode
  • tests.fetchpatch.fileWithApostrophe
  • tests.fetchpatch.fileWithSpace
  • tests.fetchpatch.full
  • tests.fetchpatch.hunks
  • tests.fetchpatch.relative
  • tests.fetchpatch.simple
  • tests.fetchpatch2.decode
  • tests.fetchpatch2.fileWithApostrophe
  • tests.fetchpatch2.fileWithSpace
  • tests.fetchpatch2.full
  • tests.fetchpatch2.hunks
  • tests.fetchpatch2.relative
  • tests.fetchpatch2.simple
  • tests.fetchurl.hashedMirrors
  • tests.fetchurl.no-skipPostFetch
  • tests.fetchzip.hiddenDir
  • tests.fetchzip.postFetch
  • tests.fetchzip.simple
  • tests.haskell.cabalSdist.assumptionLocalHasDirectReference
  • tests.haskell.cabalSdist.localHasNoDirectReference
  • tests.testers.runCommand.dns-resolution
  • tests.testers.runCommand.nonDefault-hash

Error logs: `x86_64-darwin`
tests.fetchurl.header
  0     0   0     0   0     0     0     0  --:--:-- --:--:-- --:--:--     0
  0     0   0     0   0     0     0     0  --:--:-- --:--:-- --:--:--     0
curl: (22) SSL certificate OpenSSL verify result: unable to get local issuer certificate (20)
Warning: Problem : HTTP error. Will retry in 1 second. 3 retries left.

0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (22) The requested URL returned error: 503
Warning: Problem : HTTP error. Will retry in 2 seconds. 2 retries left.

0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (22) The requested URL returned error: 503
Warning: Problem : HTTP error. Will retry in 4 seconds. 1 retry left.

0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (22) The requested URL returned error: 503
error: cannot download source-salted-17012ixz0pxx from any mirror

tests.testers.runCommand.bork
                    exc.stdout, exc.stderr = process.communicate()
                else:
                    # POSIX _communicate already populated the output so
                    # far into the TimeoutExpired exception.
                    process.wait()
                raise
            except:  # Including KeyboardInterrupt, communicate handled that.
                process.kill()
                # We don't call process.wait() as .__exit__ does that for us.
                raise
            retcode = process.poll()
            if check and retcode:
>               raise CalledProcessError(retcode, process.args,
                                         output=stdout, stderr=stderr)
E               subprocess.CalledProcessError: Command '['/nix/store/84s01mzl74vh69aphpl3rf07pp49pkz0-python3-3.13.9/bin/python3.13', '-m', 'bork', 'download', 'gh:duckinator/emanate', 'v7.0.0']' returned non-zero exit status 1.

/nix/store/84s01mzl74vh69aphpl3rf07pp49pkz0-python3-3.13.9/lib/python3.13/subprocess.py:577: CalledProcessError
=========================== short test summary info ============================
FAILED bork/tests/test_cmd_download.py::test_download - subprocess.CalledProcessError: Command '['/nix/store/84s01mzl74vh69aphpl3rf...
================== 1 failed, 3 passed, 5 deselected in 44.81s ==================


aarch64-darwin (sandbox = relaxed)

❌ 1 package failed to build:
  • tests.fetchurl.header
✅ 57 packages built:
  • tests.fetchDebianPatch.libPackage
  • tests.fetchDebianPatch.simple
  • tests.fetchFirefoxAddon.simple (tests.fetchFirefoxAddon.overridden-source)
  • tests.fetchFromBitbucket.withEncodedWhitespace
  • tests.fetchFromBitbucket.withEncodedWhitespaceGit
  • tests.fetchFromBitbucket.withoutWhitespace
  • tests.fetchFromGitHub.dumb-http-signed-tag
  • tests.fetchFromGitHub.fetchTags
  • tests.fetchFromGitHub.leave-git
  • tests.fetchFromGitHub.rootDir
  • tests.fetchFromGitHub.simple
  • tests.fetchFromGitHub.sparseCheckout
  • tests.fetchFromGitHub.sparseCheckoutNonConeMode
  • tests.fetchFromGitHub.submodule-deep
  • tests.fetchFromGitHub.submodule-leave-git
  • tests.fetchFromGitHub.submodule-leave-git-deep
  • tests.fetchFromGitHub.submodule-simple
  • tests.fetchNextcloudApp.simple-sha256
  • tests.fetchNextcloudApp.simple-sha512
  • tests.fetchPypiLegacy.fetchSimple
  • tests.fetchgit.dumb-http-signed-tag
  • tests.fetchgit.fetchTags
  • tests.fetchgit.leave-git
  • tests.fetchgit.prefetch-git-no-add-path
  • tests.fetchgit.rootDir
  • tests.fetchgit.simple
  • tests.fetchgit.sparseCheckout
  • tests.fetchgit.sparseCheckoutNonConeMode
  • tests.fetchgit.submodule-deep
  • tests.fetchgit.submodule-leave-git
  • tests.fetchgit.submodule-leave-git-deep
  • tests.fetchgit.submodule-simple
  • tests.fetchgit.withGitConfig
  • tests.fetchpatch.decode
  • tests.fetchpatch.fileWithApostrophe
  • tests.fetchpatch.fileWithSpace
  • tests.fetchpatch.full
  • tests.fetchpatch.hunks
  • tests.fetchpatch.relative
  • tests.fetchpatch.simple
  • tests.fetchpatch2.decode
  • tests.fetchpatch2.fileWithApostrophe
  • tests.fetchpatch2.fileWithSpace
  • tests.fetchpatch2.full
  • tests.fetchpatch2.hunks
  • tests.fetchpatch2.relative
  • tests.fetchpatch2.simple
  • tests.fetchurl.hashedMirrors
  • tests.fetchurl.no-skipPostFetch
  • tests.fetchzip.hiddenDir
  • tests.fetchzip.postFetch
  • tests.fetchzip.simple
  • tests.haskell.cabalSdist.assumptionLocalHasDirectReference
  • tests.haskell.cabalSdist.localHasNoDirectReference
  • tests.testers.runCommand.bork
  • tests.testers.runCommand.dns-resolution
  • tests.testers.runCommand.nonDefault-hash

Error logs: `aarch64-darwin`
tests.fetchurl.header
  0     0   0     0   0     0     0     0  --:--:-- --:--:-- --:--:--     0
  0     0   0     0   0     0     0     0  --:--:-- --:--:-- --:--:--     0
curl: (22) SSL certificate OpenSSL verify result: unable to get local issuer certificate (20)
Warning: Problem : HTTP error. Will retry in 1 second. 3 retries left.

0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (22) The requested URL returned error: 503
Warning: Problem : HTTP error. Will retry in 2 seconds. 2 retries left.

0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (22) The requested URL returned error: 503
Warning: Problem : HTTP error. Will retry in 4 seconds. 1 retry left.

0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (22) The requested URL returned error: 503
error: cannot download source-salted-5gnsz71jc8lp from any mirror

@nixpkgs-ci nixpkgs-ci bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Dec 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.status: merge conflict This PR has merge conflicts with the target branch 6.topic: fetch Fetchers (e.g. fetchgit, fetchsvn, ...) 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant