From 016a24e4dc5c587259c2bf76f4451241c08fa727 Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Thu, 31 Oct 2024 23:57:06 +0000 Subject: [PATCH] apptainer, singularity: deprecate workarounds for vendorHash overriding Remove obsolete overriding workarounds for vendorHash, deleteVendor and proxyVendor (through the .override interface). The workaround functionality has been fixed by commit eed069a5bc40 ("buildGoModule: fix overrideAttrs overriding"), and these arguments can now be overridden using .overrideAttrs. --- doc/release-notes/rl-2505.section.md | 4 +++ .../virtualization/singularity/generic.nix | 27 ++++++++++++++----- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/doc/release-notes/rl-2505.section.md b/doc/release-notes/rl-2505.section.md index 3651dcc64cb6..fa6464a059f3 100644 --- a/doc/release-notes/rl-2505.section.md +++ b/doc/release-notes/rl-2505.section.md @@ -8,6 +8,10 @@ - `services.rippleDataApi` has been removed, as `ripple-data-api` was broken and had not been updated since 2022. +- `apptainer` and `singularity` deprecate the workaround of overriding `vendorHash` and related attributes via `.override`, + in favour of the unified overriding of the same group of attributes via `.overrideAttrs`. + The compatibility layer will be removed in future releases. + - `squid` has been updated to version 7, this release includes multiple breaking changes, like ESI removal. For more information, [check the release notes](https://github.com/squid-cache/squid/releases/tag/SQUID_7_0_1). diff --git a/pkgs/applications/virtualization/singularity/generic.nix b/pkgs/applications/virtualization/singularity/generic.nix index 29191dba702d..f0e6af36de96 100644 --- a/pkgs/applications/virtualization/singularity/generic.nix +++ b/pkgs/applications/virtualization/singularity/generic.nix @@ -16,7 +16,8 @@ let # Backward compatibility layer for the obsolete workaround of # the "vendor-related attributes not overridable" issue (#86349), - # whose solution is merged and released. + # whose solution (#225051) is merged and released. + # TODO(@ShamrockLee): Remove after the Nixpkgs 25.05 branch-off. _defaultGoVendorArgs = { inherit vendorHash deleteVendor proxyVendor; }; @@ -96,14 +97,28 @@ in # "path/to/source/file1" = [ "" "" ... ]; # } sourceFilesWithDefaultPaths ? { }, - # Workaround #86349 - # should be removed when the issue is resolved - vendorHash ? _defaultGoVendorArgs.vendorHash, - deleteVendor ? _defaultGoVendorArgs.deleteVendor, - proxyVendor ? _defaultGoVendorArgs.proxyVendor, + # Placeholders for the obsolete workaround of #86349 + # TODO(@ShamrockLee): Remove after the Nixpkgs 25.05 branch-off. + vendorHash ? null, + deleteVendor ? null, + proxyVendor ? null, }@args: let + # Backward compatibility layer for the obsolete workaround of #86349 + # TODO(@ShamrockLee): Convert to simple inheritance after the Nixpkgs 25.05 branch-off. + moduleArgsOverridingCompat = + argName: + if args.${argName} or null == null then + _defaultGoVendorArgs.${argName} + else + lib.warn + "${projectName}: Override ${argName} with .override is deprecated. Use .overrideAttrs instead." + args.${argName}; + vendorHash = moduleArgsOverridingCompat "vendorHash"; + deleteVendor = moduleArgsOverridingCompat "deleteVendor"; + proxyVendor = moduleArgsOverridingCompat "proxyVendor"; + addShellDoubleQuotes = s: lib.escapeShellArg ''"'' + s + lib.escapeShellArg ''"''; in (buildGoModule {