prefetch-npm-deps override does not work correctly on 23.11, causing rebuilds #24

Closed
opened 2024-05-06 11:15:43 +00:00 by midnightveil · 3 comments
Member

The code added in commit 04186bcae3 which conditionally overrides the arguments to prefetch-npm-deps does not work on nixos-23.11.

    if (lib.functionArgs prev.prefetch-npm-deps.override) ? nix

This appears to be because pkgs.callPackages (how prefetch-npm-deps appears in all-packages.nix) did not propagate the function arguments correctly until nixpkgs commit 741377, which appears to not have been backported to 23.11.

nix-repl> lib.functionArgs (pkgs.unstable.prefetch-npm-deps.override)
{
  cacert = false;
  curl = false;
  fetchNpmDeps = false;
  /* elided for clarity */
}

nix-repl> lib.functionArgs (pkgs.prefetch-npm-deps.override)          
{ }

My solution was just to force the override in an overlay myself, though this is not optimal.

prefetch-npm-deps = prev.prefetch-npm-deps.override {
  nix = final.nixVersions.nix_2_18_upstream;
};
The code added in commit 04186bcae389b43c3ed8e4054068eb520b3f2349 which conditionally overrides the arguments to `prefetch-npm-deps` does not work on nixos-23.11. ```nix if (lib.functionArgs prev.prefetch-npm-deps.override) ? nix ``` This appears to be because `pkgs.callPackages` (how `prefetch-npm-deps` appears in all-packages.nix) did not propagate the function arguments correctly until nixpkgs commit [741377](https://github.com/NixOS/nixpkgs/commit/741377b30058c5742e5ae08b1d8a85bcc9aa6d55), which appears to not have been backported to 23.11. ``` nix-repl> lib.functionArgs (pkgs.unstable.prefetch-npm-deps.override) { cacert = false; curl = false; fetchNpmDeps = false; /* elided for clarity */ } nix-repl> lib.functionArgs (pkgs.prefetch-npm-deps.override) { } ``` My solution was just to force the override in an overlay myself, though this is not optimal. ```nix prefetch-npm-deps = prev.prefetch-npm-deps.override { nix = final.nixVersions.nix_2_18_upstream; }; ```
Owner

what the heck, we collectively tested this change when i committed it. will look into it later today.

what the heck, we collectively tested this change when i committed it. will look into it later today.
Owner

This should be fixed by 7e8a5498db - could you check?

This should be fixed by https://git.lix.systems/lix-project/nixos-module/commit/7e8a5498db41de8c67315b4a2a4f82a2072ee73b - could you check?
Author
Member

Yep, fixed.

Yep, fixed.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/nixos-module#24
No description provided.