about summary refs log tree commit diff
path: root/src/nix (follow)
AgeCommit message (Collapse)AuthorFilesLines
2020-02-18 DohEelco Dolstra1-1/+1
2020-02-18 Disable the progress bar if $TERM == dumb or unsetEelco Dolstra1-1/+3
Fixes #3363. (cherry picked from commit d8fd31f50ff55f7f334a2b9e58a82570e82ec28d)
2020-01-04 SourceExprCommand::getSourceExpr(): Allocate more spaceEelco Dolstra1-1/+1
Fixes #3140. (cherry picked from commit 389a2cebed7cd72bda524ece0a56af2888cd80b6)
2020-01-04 include netinet/in.h in src/nix/main.ccng01-0/+1
Fixes #3186 (cherry picked from commit b811bd2172bc9796f42b87996f455d4e5e4382ba)
2020-01-04 Fix progress bar when nix-prefetch-url is piped.Harald van Dijk1-1/+1
The intent of the code was that if the window size cannot be determined, it would be treated as having the maximum possible size. Because of a missing assignment, it was actually treated as having a width of 0. The reason the width could not be determined was because it was obtained from stdout, not stderr, even though the printing was done to stderr. This commit addresses both issues. (cherry picked from commit c935ad3f025d5c3d8026711a1eb50b2917b61d59)
2019-10-10 nix verify: Fix uninitialized variableEelco Dolstra1-2/+2
(cherry picked from commit 95cf23ee7c5b0fd69b21811989a5668f4261fd51)
2019-10-09 Filter ANSI escape sequences in -L outputEelco Dolstra1-1/+1
Otherwise, builds like NixOS VM tests may leave the terminal in a weird state and do resets. (cherry picked from commit 4331eeb13d241dfe2d2e6a01c53915c556cac94f)
2019-10-09 Don't catch exceptions by valueEelco Dolstra1-1/+1
(cherry picked from commit 893be6f5e36abb58bbaa9c49055a5218114dd514) (cherry picked from commit bd79c1f6f6391786772a8a79962abe22f374cca4)
2019-10-09 nix search: remove verbose exampleSam Doshi1-4/+0
(cherry picked from commit 6f6cb5e3880d0c7a1dd2bc13c2e0be8ce0ae9fa1)
2019-10-09 nix search: Don't quietly ignore errorsEelco Dolstra1-0/+1
(cherry picked from commit 7c74f075f4a7274ad38c90085cc269a19a977438)
2019-10-09 getSourceExpr(): Handle channelsEelco Dolstra1-15/+16
Fixes #1892. Fixes #1865. Fixes #3119. (cherry picked from commit e6e61f0a54dac0174df996e93fcfedcac7769ab4)
2019-08-27 Merge branch 'test-sandboxing' of https://github.com/matthewbauer/nixEelco Dolstra1-1/+4
2019-08-02 Add a post-build-hookregnat1-2/+14
Passing `--post-build-hook /foo/bar` to a nix-* command will cause `/foo/bar` to be executed after each build with the following environment variables set: DRV_PATH=/nix/store/drv-that-has-been-built.drv OUT_PATHS=/nix/store/...build /nix/store/...build-bin /nix/store/...build-dev This can be useful in particular to upload all the builded artifacts to the cache (including the ones that don't appear in the runtime closure of the final derivation or are built because of IFD). This new feature prints the stderr/stdout output to the `nix-build` and `nix build` client, and the output is printed in a Nix 2 compatible format: [nix]$ ./inst/bin/nix-build ./test.nix these derivations will be built: /nix/store/ishzj9ni17xq4hgrjvlyjkfvm00b0ch9-my-example-derivation.drv building '/nix/store/ishzj9ni17xq4hgrjvlyjkfvm00b0ch9-my-example-derivation.drv'... hello! bye! running post-build-hook '/home/grahamc/projects/github.com/NixOS/nix/post-hook.sh'... post-build-hook: + sleep 1 post-build-hook: + echo 'Signing paths' /nix/store/qr213vjmibrqwnyp5fw678y7whbkqyny-my-example-derivation post-build-hook: Signing paths /nix/store/qr213vjmibrqwnyp5fw678y7whbkqyny-my-example-derivation post-build-hook: + sleep 1 post-build-hook: + echo 'Uploading paths' /nix/store/qr213vjmibrqwnyp5fw678y7whbkqyny-my-example-derivation post-build-hook: Uploading paths /nix/store/qr213vjmibrqwnyp5fw678y7whbkqyny-my-example-derivation post-build-hook: + sleep 1 post-build-hook: + printf 'very important stuff' /nix/store/qr213vjmibrqwnyp5fw678y7whbkqyny-my-example-derivation [nix-shell:~/projects/github.com/NixOS/nix]$ ./inst/bin/nix build -L -f ./test.nix my-example-derivation> hello! my-example-derivation> bye! my-example-derivation (post)> + sleep 1 my-example-derivation (post)> + echo 'Signing paths' /nix/store/c263gzj2kb2609mz8wrbmh53l14wzmfs-my-example-derivation my-example-derivation (post)> Signing paths /nix/store/c263gzj2kb2609mz8wrbmh53l14wzmfs-my-example-derivation my-example-derivation (post)> + sleep 1 my-example-derivation (post)> + echo 'Uploading paths' /nix/store/c263gzj2kb2609mz8wrbmh53l14wzmfs-my-example-derivation my-example-derivation (post)> Uploading paths /nix/store/c263gzj2kb2609mz8wrbmh53l14wzmfs-my-example-derivation my-example-derivation (post)> + sleep 1 my-example-derivation (post)> + printf 'very important stuff' [1 built, 0.0 MiB DL] Co-authored-by: Graham Christensen <graham@grahamc.com> Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2019-07-25 Disable CLONE_NEWUSER when it’s unavailableMatthew Bauer1-1/+4
Some kernels disable "unpriveleged user namespaces". This is unfortunate, but we can still use mount namespaces. Anyway, since each builder has its own nixbld user, we already have most of the benefits of user namespaces.
2019-07-10 nix copy: Rename --substitute to --substitute-on-destinationEelco Dolstra1-1/+1
'--substitute' was being shadowed by the regular '--substitute' (the short-hand for '--option substitute true'). Fixes #2983.
2019-07-03 Get BOOST_LDFLAGS from autoconf, fix Ubuntu 16.04 build.Niklas Hambüchen1-1/+1
Our use of boost::coroutine2 depends on -lboost_context, which in turn depends on `-lboost_thread`, which in turn depends on `-lboost_system`. I suspect that this builds on nix only because of low-level hacks like NIX_LDFLAGS. This commit passes the proper linker flags, thus fixing bootstrap builds on non-nix distributions like Ubuntu 16.04. With these changes, I can build Nix on Ubuntu 16.04 using: ./bootstrap.sh ./configure --prefix=$HOME/editline-prefix \ --disable-doc-gen \ CXX=g++-7 \ --with-boost=$HOME/boost-prefix \ EDITLINE_CFLAGS=-I$HOME/editline-prefix/include \ EDITLINE_LIBS=-leditline \ LDFLAGS=-L$HOME/editline-prefix/lib make where * g++-7 comes from gcc-7 from https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test, * editline 1.14 from https://github.com/troglobit/editline/releases/tag/1.14.0 was installed into `$HOME/editline-prefix` (because Ubuntu 16.04's `editline` is too old to have the function nix uses), * boost 1.66 from https://www.boost.org/doc/libs/1_66_0/more/getting_started/unix-variants.html was installed into $HOME/boost-prefix (because Ubuntu 16.04 only has 1.58)
2019-07-03 Fix C++ compatibility with older editline versions.Niklas Hambüchen1-0/+7
For example, Ubuntu 16.04 and many similar long-term-support distros have older versions.
2019-06-28 Fix macOS build failureEelco Dolstra1-2/+2
Issue #2976.
2019-06-25 ProgressBar: Fix updatingEelco Dolstra1-11/+15
'updateCV.notify_one()' does nothing if the update thread is not waiting for updateCV (in particular this happens when it is sleeping on quitCV). So also set a variable to ensure that the update isn't lost.
2019-06-25 Automatically use --no-net if there are no network interfacesEelco Dolstra1-0/+55
(cherry picked from commit 04a59769963fe2a28d10ba15de743fe499333c80)
2019-06-25 Add "warning" verbosity levelEelco Dolstra1-1/+1
This ensures that "nix" shows warnings. Previously these were hidden because they were at "info" level. (cherry picked from commit 615a9d031d22a6aee64f8511e15685e47b6f8796)
2019-06-15 nix: Add -L alias for --print-build-logsEelco Dolstra1-0/+1
2019-05-21 Merge pull request #2800 from flokli/progress-bar-hide-unknown-expectedEelco Dolstra1-4/+11
progress-bar: hide expected if expected is 0 (unknown)
2019-05-15 Merge pull request #2810 from NixOS/print-build-logsEelco Dolstra3-13/+38
nix: Add --print-build-logs flag
2019-05-15 nix: Add --print-build-logs flagEelco Dolstra3-13/+38
This causes 'nix' to print build log output to stderr rather than showing the last log line in the progress bar. Log lines are prefixed by the name of the derivation (minus the version string), e.g. binutils> make[1]: Leaving directory '/build/binutils-2.31.1' binutils-wrapper> unpacking sources binutils-wrapper> patching sources ... binutils-wrapper> Using dynamic linker: '/nix/store/kr51dlsj9v5cr4n8700jliyz8v5b2q7q-bootstrap-stage0-glibc/lib/ld-linux-x86-64.so.2' bootstrap-stage2-gcc-wrapper> unpacking sources ... linux-headers> unpacking sources linux-headers> unpacking source archive /nix/store/8javli69jhj3bkql2c35gsj5vl91p382-linux-4.19.16.tar.xz
2019-05-11 progress-bar: hide expected if expected is 0 (unknown)Florian Klink1-4/+11
Sometimes, "expected" can be "0", but in fact means "unknown". This is for example the case when downloading a file while the http server doesn't send the `Content-Length` header, like when running `nix build` pointing to a nixpkgs checkout streamed from GitHub: ⇒ nix build -f https://github.com/NixOS/nixpkgs/archive/master.tar.gz hello [1.8/0.0 MiB DL] downloading 'https://github.com/NixOS/nixpkgs/archive/master.tar.gz' In that case, don't show that weird progress bar, but only the (slowly increasing) downloaded size ("done"). ⇒ nix build -f https://github.com/NixOS/nixpkgs/archive/master.tar.gz hello [1.8 MiB DL] downloading 'https://github.com/NixOS/nixpkgs/archive/master.tar.gz' This commit also updates fmt calls with three numbers (when something is currently 'running' too) - I'm not sure if this can be provoked, but showing "0" as expected doesn't make any sense, as we're obviously doing more than nothing.
2019-03-24 repl: Restore CTRL-C behaviourxbreak1-0/+40
Install signal handler during `readline` to handle SIGINT to abort partially typed expressions.
2019-03-14 experimental/optional -> optionalEelco Dolstra1-1/+1
2019-02-05 Revert "Restore parent mount namespace before executing a child process"Eelco Dolstra3-9/+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.
2019-01-10 Merge pull request #2617 from veprbl/pr/V547_nix_repl.ccEelco Dolstra1-18/+1
remove some dead code in nix/repl.cc
2019-01-05 Remove mentions of `libformat`, it no longer existsJohn Ericson1-1/+1
2018-12-25 remove some dead code in nix/repl.ccDmitry Kalinkin1-18/+1
Fixes a static analyzer warning: Expression 'isDrv' is always false. Fixes: 3beb6f6e7 ('Show derivations more concisely')
2018-12-13 Support SRI hashesEelco Dolstra1-9/+14
SRI hashes (https://www.w3.org/TR/SRI/) combine the hash algorithm and a base-64 hash. This allows more concise and standard hash specifications. For example, instead of import <nix/fetchurl.nl> { url = https://nixos.org/releases/nix/nix-2.1.3/nix-2.1.3.tar.xz; sha256 = "5d22dad058d5c800d65a115f919da22938c50dd6ba98c5e3a183172d149840a4"; }; you can write import <nix/fetchurl.nl> { url = https://nixos.org/releases/nix/nix-2.1.3/nix-2.1.3.tar.xz; hash = "sha256-XSLa0FjVyADWWhFfkZ2iKTjFDda6mMXjoYMXLRSYQKQ="; }; In fixed-output derivations, the outputHashAlgo is no longer mandatory if outputHash specifies the hash (either as an SRI or in the old "<type>:<hash>" format). 'nix hash-{file,path}' now print hashes in SRI format by default. I also reverted them to use SHA-256 by default because that's what we're using most of the time in Nixpkgs. Suggested by @zimbatm.
2018-12-12 nix repl: don't create result symlinksDaiderd Jordan1-1/+1
2018-11-20 repl: give user the choice between libeditline and libreadlineKai Harries1-0/+9
The goal is to support libeditline AND libreadline and let the user decide at compile time which one to use. Add a compile time option to use libreadline instead of libeditline. If compiled against libreadline completion functionality is lost because of a incompatibility between libeditlines and libreadlines completion function. Completion with libreadline is possible and can be added later. To use libreadline instead of libeditline the environment variables 'EDITLINE_LIBS' and 'EDITLINE_CFLAGS' have to been set during the ./configure step. Example: EDITLINE_LIBS="/usr/lib/x86_64-linux-gnu/libhistory.so /usr/lib/x86_64-linux-gnu/libreadline.so" EDITLINE_CFLAGS="-DREADLINE" The reason for this change is that for example on Debian already three different editline libraries exist but none of those is compatible the flavor used by nix. My hope is that with this change it would be easier to port nix to systems that have already libreadline available.
2018-11-20 repl: Remove code that was commented outKai Harries1-2/+0
2018-11-16 nix ls-nar: allow reading from FIFOsLinus Heckemann1-1/+1
fixes #2528
2018-11-13 Merge branch 'feature/editline-pr' of https://github.com/dtzWill/nixEelco Dolstra2-33/+77
2018-11-13 Restore parent mount namespace before executing a child processEelco Dolstra3-2/+9
This ensures that they can't write to /nix/store. Fixes #2535.
2018-10-29 repl: complete if all matches share prefixWill Dietz1-0/+18
2018-10-29 editline: wipWill Dietz2-33/+59
2018-10-29 nix doctor: return nonzero exitcode if a check failsDaiderd Jordan1-6/+20
This makes it easier to use this when testing the installer or when running the checks with other automated tooling.
2018-10-27 Fix signedness warningEelco Dolstra1-1/+1
2018-10-27 Merge branch 'nix-doctor' of https://github.com/LnL7/nixEelco Dolstra1-0/+110
2018-10-26 src/nix/local.mk: fix typos in names of symlinksWill Dietz1-1/+1
2018-10-26 Merge all nix-* binaries into nixEelco Dolstra2-6/+21
These are all symlinks to 'nix' now, reducing the installed size by about ~1.7 MiB.
2018-10-08 Merge pull request #2452 from ElvishJerricco/verify-sigs-overflowEelco Dolstra1-1/+1
Fix overflow when verifying signatures of content addressable paths
2018-09-27 Don't talk about a "current folder build output"Eelco Dolstra1-4/+4
Presumably this refers to ./default.nix but the support for that in 'nix' is tenuous. Also folders are a Mac thing.
2018-09-26 nix doctor: reimplement profile warning without gcroot checkDaiderd Jordan1-20/+19
Calculating roots seems significantly slower on darwin compared to linux. Checking for /profile/ links could show some false positives but should still catch most issues.
2018-09-25 Fix overflow when verifying signatures of content addressable pathsWill Fancher1-1/+1