Loading pkgs/build-support/trivial-builders/default.nix +87 −61 Original line number Diff line number Diff line Loading @@ -935,7 +935,20 @@ rec { # Docs in doc/build-helpers/fetchers.chapter.md # See https://nixos.org/manual/nixpkgs/unstable/#requirefile requireFile = requireFile = lib.extendMkDerivation { constructDrv = stdenv.mkDerivation; excludeDrvArgNames = [ "hash" "hashMode" "message" "sha1" "sha256" "url" ]; extendDrvArgs = finalAttrs: { name ? null, sha256 ? null, Loading @@ -944,7 +957,7 @@ rec { url ? null, message ? null, hashMode ? "flat", }: }@args: assert (message != null) || (url != null); assert (sha256 != null) || (sha1 != null) || (hash != null); assert (name != null) || (url != null); Loading Loading @@ -978,8 +991,7 @@ rec { sha1; name_ = if name == null then baseNameOf (toString url) else name; in stdenvNoCC.mkDerivation { name = name_; { outputHashMode = hashMode; outputHashAlgo = hashAlgo_; outputHash = hash_; Loading @@ -995,6 +1007,20 @@ rec { _EOF_ exit 1 ''; } // (lib.optionalAttrs (name == null) { # The case of providing `url`, but not `name`. This has # weird interactions with the positioning system # When we set `name` explicitly here, we override where the # position is read from. So we must fix it here. pos = lib.unsafeGetAttrPos "url" args; # If a name is not provided, use the basename of the url name = builtins.warn "providing a URL without a name is deprecated" baseNameOf (toString url); }); inheritFunctionArgs = false; }; # TODO: move copyPathToStore docs to the Nixpkgs manual Loading Loading
pkgs/build-support/trivial-builders/default.nix +87 −61 Original line number Diff line number Diff line Loading @@ -935,7 +935,20 @@ rec { # Docs in doc/build-helpers/fetchers.chapter.md # See https://nixos.org/manual/nixpkgs/unstable/#requirefile requireFile = requireFile = lib.extendMkDerivation { constructDrv = stdenv.mkDerivation; excludeDrvArgNames = [ "hash" "hashMode" "message" "sha1" "sha256" "url" ]; extendDrvArgs = finalAttrs: { name ? null, sha256 ? null, Loading @@ -944,7 +957,7 @@ rec { url ? null, message ? null, hashMode ? "flat", }: }@args: assert (message != null) || (url != null); assert (sha256 != null) || (sha1 != null) || (hash != null); assert (name != null) || (url != null); Loading Loading @@ -978,8 +991,7 @@ rec { sha1; name_ = if name == null then baseNameOf (toString url) else name; in stdenvNoCC.mkDerivation { name = name_; { outputHashMode = hashMode; outputHashAlgo = hashAlgo_; outputHash = hash_; Loading @@ -995,6 +1007,20 @@ rec { _EOF_ exit 1 ''; } // (lib.optionalAttrs (name == null) { # The case of providing `url`, but not `name`. This has # weird interactions with the positioning system # When we set `name` explicitly here, we override where the # position is read from. So we must fix it here. pos = lib.unsafeGetAttrPos "url" args; # If a name is not provided, use the basename of the url name = builtins.warn "providing a URL without a name is deprecated" baseNameOf (toString url); }); inheritFunctionArgs = false; }; # TODO: move copyPathToStore docs to the Nixpkgs manual Loading