From 25c0077a31203850dff6d8ad554bcf9c76ec1018 Mon Sep 17 00:00:00 2001 From: Valentin Gagarin Date: Mon, 13 Nov 2023 21:23:56 +0100 Subject: doc: add note on which variables are effective The build log of the following won't output `foo` as one might expect, but the `$PATH` set by stdenv. ```nix with import {}; runCommand "foo" { PATH = "foo"; } "echo $PATH; touch $out" ``` --- pkgs/build-support/trivial-builders/default.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'pkgs') diff --git a/pkgs/build-support/trivial-builders/default.nix b/pkgs/build-support/trivial-builders/default.nix index 3fd71e8f44322..bdb79d9bf463c 100644 --- a/pkgs/build-support/trivial-builders/default.nix +++ b/pkgs/build-support/trivial-builders/default.nix @@ -13,6 +13,7 @@ rec { Run the shell command `buildCommand' to produce a store path named `name'. The attributes in `env' are added to the environment prior to running the command. + Environment variables set by `stdenv.mkDerivation` take precedence. By default `runCommand` runs in a stdenv with no compiler environment. `runCommandCC` uses the default stdenv, `pkgs.stdenv`. -- cgit 1.4.1