about summary refs log tree commit diff
path: root/src/nix-build/nix-build.cc
AgeCommit message (Collapse)AuthorFilesLines
2019-05-08 nix-shell: Don't absolutize '-p' expressionsEelco Dolstra1-5/+7
This prevents spurious syscalls like 25011 lstat("/home/eelco/with import <nixpkgs> { }; (pkgs.runCommandCC or pkgs.runCommand) \"shell\" { buildInputs = [ (hello) ]; } \"\"", 0x7ffe9c67f580) = -1 ENOENT (No such file or directory)
2019-02-05 Revert "Restore parent mount namespace before executing a child process"Eelco Dolstra1-2/+2
This reverts commit a0ef21262f4d5652bfb65cfacaec01d89c475a93. This doesn't work in 'nix run' and nix-shell because setns() fails in multithreaded programs, and Boehm GC mark threads are uncancellable. Fixes #2646.
2018-11-13 Restore parent mount namespace before executing a child processEelco Dolstra1-2/+2
This ensures that they can't write to /nix/store. Fixes #2535.
2018-10-26 Merge all nix-* binaries into nixEelco Dolstra1-10/+4
These are all symlinks to 'nix' now, reducing the installed size by about ~1.7 MiB.
2018-09-27 nix-shell: add bashInteractive to the start of the PATH, set SHELLGraham Christensen1-2/+6
Tools which re-exec `$SHELL` or `$0` or `basename $SHELL` or even just `bash` will otherwise get the non-interactive bash, providing a broken shell for the same reasons described in https://github.com/NixOS/nixpkgs/issues/27493. Extends c94f3d5575d7af5403274d1e9e2f3c9d72989751
2018-08-31 nix-build: Print stats even in failing buildsGraham Christensen1-1/+2
2018-08-31 nix-build: print stats on sucessful buildsGraham Christensen1-0/+1
2018-08-20 Drop all references to NIX_INDENT_MAKETuomas Tynkkynen1-1/+0
Dead code since https://github.com/NixOS/nixpkgs/commit/6669a3b47711dc967df0ea8ff93fa9857aad015d
2018-08-03 Merge pull request #2323 from samueldr/feature/selective-impurityEelco Dolstra1-1/+6
Allows selectively adding environment variables to pure shells.
2018-08-02 Allows selectively adding environment variables to pure shells.Samuel Dionne-Riel1-1/+6
Includes documentation and test.
2018-08-01 Removes unused variable from `nix-build/nix-shell`Samuel Dionne-Riel1-1/+0
This particular `shell` variable wasn't used, since a new one was declared in the only side of the `if` branch that used a `shell` variable. It could realistically confuse developers thinking it could use `$SHELL` under some situations.
2018-06-12 Move EvalState from the stack to the heapEelco Dolstra1-14/+14
EvalState contains a few counters (e.g. nrValues) that increase quickly enough that they end up being interpreted as pointers by the garbage collector. Moving it to the heap makes them invisible to the garbage collector. This reduces the max RSS doing 100 evaluations of nixos.tests.firefox.x86_64-linux.drvPath from 455 MiB to 292 MiB. Note: ideally, allocations would be much further up in the 64-bit address space to reduce the odds of an integer being misinterpreted as a pointer. Maybe we can use some linker magic to move the .bss segment to a higher address.
2018-05-07 nix-shell: Only download requested outputsEelco Dolstra1-1/+1
Fixes #2116.
2018-04-07 nix-shell: Fixes use with ruby shebangs.Samuel Dionne-Riel1-1/+1
The ported code in 80ebc553eca19dafc64c47420cd49ddd506bc9b7 was incorrectly ported. ``` - $envCommand = "exec $execArgs $interpreter -e 'load(\"$script\")' -- ${\(join ' ', (map shellEscape, @savedArgs))}"; ... + envCommand = (format("exec %1% %2% -e 'load(\"%3%\") -- %4%") % execArgs % interpreter % script % joined.str()).str(); ``` The single-quote finishing the small ruby snippet was lost in translation.
2018-03-16 nix-shell: allow symlinks to .drvsLinus Heckemann1-2/+6
This makes persistent shell environments easier to use.
2018-02-08 Add plugins to make Nix more extensible.Shea Levy1-0/+2
All plugins in plugin-files will be dlopened, allowing them to statically construct instances of the various Register* types Nix supports.
2018-02-03 Remove nix-build --hashEelco Dolstra1-3/+0
Instead, if a fixed-output derivation produces has an incorrect output hash, we now unconditionally move the outputs to the path corresponding with the actual hash and register it as valid. Thus, after correcting the hash in the Nix expression (e.g. in a fetchurl call), the fixed-output derivation doesn't have to be built again. It would still be good to have a command for reporting the actual hash of a fixed-output derivation (instead of throwing an error), but "nix-build --hash" didn't do that.
2018-02-01 nix-build: Ignore --indirectEelco Dolstra1-1/+1
Note that nix-build always creates indirect roots. Fixes #1830.
2018-01-16 Add pure evaluation modeEelco Dolstra1-2/+2
In this mode, the following restrictions apply: * The builtins currentTime, currentSystem and storePath throw an error. * $NIX_PATH and -I are ignored. * fetchGit and fetchMercurial require a revision hash. * fetchurl and fetchTarball require a sha256 attribute. * No file system access is allowed outside of the paths returned by fetch{Git,Mercurial,url,Tarball}. Thus 'nix build -f ./foo.nix' is not allowed. Thus, the evaluation result is completely reproducible from the command line arguments. E.g. nix build --pure-eval '( let nix = fetchGit { url = https://github.com/NixOS/nixpkgs.git; rev = "9c927de4b179a6dd210dd88d34bda8af4b575680"; }; nixpkgs = fetchGit { url = https://github.com/NixOS/nixpkgs.git; ref = "release-17.09"; rev = "66b4de79e3841530e6d9c6baf98702aa1f7124e4"; }; in (import (nix + "/release.nix") { inherit nix nixpkgs; }).build.x86_64-linux )' The goal is to enable completely reproducible and traceable evaluation. For example, a NixOS configuration could be fully described by a single Git commit hash. 'nixos-rebuild' would do something like nix build --pure-eval '( (import (fetchGit { url = file:///my-nixos-config; rev = "..."; })).system ') where the Git repository /my-nixos-config would use further fetchGit calls or Git externals to fetch Nixpkgs and whatever other dependencies it has. Either way, the commit hash would uniquely identify the NixOS configuration and allow it to reproduced.
2017-11-24 nix-shell/nix-build: Support .drv files againEelco Dolstra1-2/+4
Fixes #1663. Also handle '!<output-name>' (#1694).
2017-10-30 nix-build: Fix --hashEelco Dolstra1-0/+3
2017-10-25 Pass lists/attrsets to bash as (associative) arraysEelco Dolstra1-4/+0
2017-10-24 nix: Respect -I, --arg, --argstrEelco Dolstra1-12/+11
Also, random cleanup to argument handling.
2017-10-19 nix-shell: Fix file name resolution in shebangsShea Levy1-1/+1
2017-09-18 nix-shell: Ignore readFile() errorsEelco Dolstra1-5/+5
Fixes #1563.
2017-07-30 Replace Unicode quotes in user-facing strings by ASCIIJörg Thalheim1-4/+4
Relevant RFC: NixOS/rfcs#4 $ ag -l | xargs sed -i -e "/\"/s/’/'/g;/\"/s/‘/'/g"
2017-07-28 nix-build: Fix regression causing all outputs to be builtEelco Dolstra1-4/+4
2017-07-26 nix-build/nix-shell: Eliminate call to nix-instantiate / nix-storeEelco Dolstra1-452/+378
Note that this removes the need for a derivation symlink, so the --drv-path and --add-drv-link flags now do nothing.
2017-07-20 nix-shell: Use bashInteractive from <nixpkgs>Eelco Dolstra1-1/+43
This adds about 0.1s to nix-shell runtime in the case where bashInteractive already exists. See discussion at https://github.com/NixOS/nixpkgs/issues/27493.
2017-07-03 nix-shell: Respect --dry-runEelco Dolstra1-0/+2
Fixes #824.
2017-05-24 Fix #1314Eelco Dolstra1-1/+2
Also, make nix-shell respect --option. (Previously it only passed it along to nix-instantiate and nix-build.)
2017-05-24 Merge branch 'topic/cores-master' of https://github.com/neilmayhew/nixEelco Dolstra1-0/+1
2017-05-24 Fix #1380Eelco Dolstra1-1/+1
It lacked a backslash. Use a raw string and single quotes around PS1 to simplify this.
2017-05-10 nix-shell: use appropriate prompt terminatorLinus Heckemann1-1/+1
If running nix-shell as root, the terminator should be # and not $.
2017-05-03 nix-shell: Implement passAsFileEelco Dolstra1-2/+15
2017-04-24 nix-shell -p: Use runCommandCCEelco Dolstra1-1/+1
This restores pre-17.03 behaviour by making gcc available.
2017-04-09 Propagate NIX_BUILD_CORES to nix-shell environmentsNeil Mayhew1-0/+1
2017-03-12 nix-shell/pure: keep environment variable SHLVLStefan Junker1-1/+1
2017-02-24 nix-shell: Better error message when the shell can't be startedEelco Dolstra1-2/+4
2017-02-24 nix-shell: Overwrite environment variablesEelco Dolstra1-1/+1
Need to remember that std::map::insert() and emplace() don't overwrite existing entries... This fixes a regression relative to 1.11 that in particular triggers in nested nix-shells. Before: $ nativeBuildInputs=/foo nix-shell -p hello --run 'hello' build input /foo does not exist After: $ nativeBuildInputs=/foo nix-shell -p hello --run 'hello' Hello, world!
2017-02-01 Restore default signal handling in child processesEelco Dolstra1-0/+2
In particular, this fixes Ctrl-C in nix-shell sessions.
2017-01-16 assign environ to a temp variable to ensure livenessJude Taylor1-3/+6
2017-01-16 nix-build: Use showManPage() and printVersion()Eelco Dolstra1-7/+3
2017-01-07 nix-shell: Fix 'nix-shell --command' doing nothing without TTYTuomas Tynkkynen1-1/+2
Regression from a5f2750e ("Fix early removal of rc-file for nix-shell"). The removal of BASH_ENV causes nothing to be executed by bash if it detects itself in a non-interactive context. Instead, just use the same condition used by bash to launch bash differently. According to bash sources, the condition (stdin and stder both must be TTYs) is specified by POSIX so this should be pretty safe to rely on. Fixes #1171 on master, needs a backport to the Perl code in 1.11.
2017-01-03 nix-shell: In #! mode, pass the last argumentEelco Dolstra1-13/+11
"i < argc - 1" should be "i < argc".
2017-01-03 nix-shell: Don't act interactive in shebangsTuomas Tynkkynen1-0/+1
I had observed that 'bash --rcfile' would do nothing in a non-interactive context and cause nothing to be executed if a script using nix-shell shebangs were run in a non-interactive context.
2017-01-03 nix-shell: Fix 'nix-shell -i'Tuomas Tynkkynen1-1/+1
The 'args' variable here is shadowing one in the outer scope and its contents end up unused. This causes any '#! nix-shell' lines to effectively be ignored. The intention here was to clear the args vector, as far as I can tell (and it seems to work).
2016-11-26 Revert "Get rid of unicode quotes (#1140)"Eelco Dolstra1-1/+1
This reverts commit f78126bfd6b6c8477fcdbc09b2f98772dbe9a1e7. There really is no need for such a massive change...
2016-11-25 Get rid of unicode quotes (#1140)Guillaume Maudoux1-1/+1
2016-10-19 Fix Darwin buildEelco Dolstra1-4/+6
Done slightly differently from https://github.com/NixOS/nix/pull/1093.