From 030e20f759d5a4e4962eabd4069fd06ae059e6f3 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 27 Sep 2016 14:10:36 +0200 Subject: Add a warning about using requireFile --- pkgs/build-support/trivial-builders.nix | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'pkgs') diff --git a/pkgs/build-support/trivial-builders.nix b/pkgs/build-support/trivial-builders.nix index 8775286b1172..692ac685d62d 100644 --- a/pkgs/build-support/trivial-builders.nix +++ b/pkgs/build-support/trivial-builders.nix @@ -97,12 +97,16 @@ rec { done < graph ''; + # Quickly create a set of symlinks to derivations. # entries is a list of attribute sets like { name = "name" ; path = "/nix/store/..."; } linkFarm = name: entries: runCommand name {} ("mkdir -p $out; cd $out; \n" + (lib.concatMapStrings (x: "ln -s '${x.path}' '${x.name}';\n") entries)); - # Require file + + # Print an error message if the file with the specified name and + # hash doesn't exist in the Nix store. Do not use this function; it + # produces packages that cannot be built automatically. requireFile = { name ? null , sha256 ? null , sha1 ? null @@ -115,8 +119,8 @@ rec { let msg = if message != null then message else '' - Unfortunately, we may not download file ${name_} automatically. - Please, go to ${url} to download it yourself, and add it to the Nix store + Unfortunately, we cannot download file ${name_} automatically. + Please go to ${url} to download it yourself, and add it to the Nix store using either nix-store --add-fixed ${hashAlgo} ${name_} or @@ -143,6 +147,7 @@ rec { ''; }; + # Search in the environment if the same program exists with a set uid or # set gid bit. If it exists, run the first program found, otherwise run # the default binary. @@ -168,12 +173,14 @@ rec { exec ${bin} "$@" ''; + # Copy a path to the Nix store. # Nix automatically copies files to the store before stringifying paths. # If you need the store path of a file, ${copyPathToStore } can be # shortened to ${}. copyPathToStore = builtins.filterSource (p: t: true); + # Copy a list of paths to the Nix store. copyPathsToStore = builtins.map copyPathToStore; -- cgit 1.4.1