about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorFilesLines
2020-04-10 Bump versionEelco Dolstra1-1/+1
2020-04-10 installer: Fix terminal colors.Greg Price1-6/+6
The install-multi-user script uses blue, green, and red colors, as well as bold and underline, to add helpful formatting that helps structure its rather voluminous output. Unfortunately, the terminal escape sequences it uses are not quite well-formed. The relevant information is all there, just obscured by some extra noise, a leading parameter `38`. Empirically, the result is: * On macOS, in both Terminal.app and iTerm2, the spurious `38` is ignored, the rest of the escape sequence is applied, and the colors show up as intended. * On Linux, in at least gnome-terminal and xterm, the spurious `38` and the next parameter after it are ignored, and what's left is applied. So in the sequence `38;4;32`, the 4 (underline) is ignored but the 32 (green) takes effect; in a more typical sequence like `38;34`, the 34 (blue) is ignored and nothing happens. These codes are all unchanged since this script's origins as a Darwin-only script -- so the fact that they work fine in common macOS terminals goes some way to explain how the bug arose. Happily, we can make the colors work as intended by just deleting the extra `38;`. Tested in all four terminals mentioned above; the new codes work correctly on all of them, and on the two macOS terminals they work exactly the same as before. --- In a bit more technical detail -- perhaps more than anyone, me included, ever wanted to know, but now that I've gone and learned it I'll write it down anyway :) -- here's what's happening in these codes: An ECMA-48 "control sequence" begins with `\033[` aka "CSI", contains any number of parameters as semicolon-separated decimal numbers (plus sometimes other wrinkles), and ends with a byte from 0x40..0x7e. In our case, with `m` aka "SGR", "Select Graphic Rendition". An SGR control sequence `\033[...m` sets colors, fonts, text styles, etc. In particular a parameter `31` means red, `32` green, `34` blue, `4` underline, and `0` means reset to normal. Those are all we use. There is also a `38`. This is used for setting colors too... but it needs arguments. `38;5;nn` is color nn from a 256-color palette, and `38;2;rr;gg;bb` has the given RGB values. There is no meaning defined for `38;1` or `38;34` etc. On seeing a parameter `38` followed by an unrecognized argument for it, apparently some implementations (as seen on macOS) discard only the `38` and others (as seen on Linux) discard the argument too before resuming. (cherry picked from commit 7313aa267b5be1e5264e4577e7bc3daec2fef282)
2020-04-10 Fix PR_SET_PDEATHSIG results in Broken pipe (#2395)Tobias Möst1-2/+8
The ssh client is lazily started by the first worker thread, that requires a ssh connection. To avoid the ssh client to be killed, when the worker process is stopped, do not set PR_SET_PDEATHSIG. (cherry picked from commit 3e347220c82d1537723f49aa03a93a6f9d294417)
2020-04-10 SimplifyEelco Dolstra1-5/+2
(cherry picked from commit d1b238ec3cd74d652af46f577f992c9a44ac8e32)
2020-04-10 libstore/ssh: Improve error message on failing `execvp`Profpatsch1-2/+6
If the `throw` is reached, this means that execvp into `ssh` wasn’t successful. We can hint at a usual problem, which is a missing `ssh` executable. Test with: ``` env PATH= ./result/bin/nix-copy-closure --builders '' unusedhost ``` and the bash version with ``` env PATH= ./result/bin/nix-copy-closure --builders '' localhost ``` (cherry picked from commit 38b29fb72ca4a07afbec1fd5067f59ca7d7f0fab)
2020-04-10 fix placeholder not substituted in passAsFilemlatus1-1/+1
(cherry picked from commit 12556e570924315eb25ad6057b6c2c5162955e4f) Signed-off-by: Domen Kožar <domen@dev.si>
2020-04-10 libexpr: show expression in assertion errorsDaiderd Jordan1-4/+7
Includes the expression of the condition in the assertion message if the assertion failed, making assertions much easier to debug. eg. error: assertion (withPython -> (python2Packages != null)) failed at pkgs/tools/security/nmap/default.nix:11:1 (cherry picked from commit 307bcb9a8e7a16bfc451e055a620b766df9d3f7d) Signed-off-by: Domen Kožar <domen@dev.si>
2020-04-10 Don't retry on "unsupported protocol" errorCole Helbling1-0/+1
When encountering an unsupported protocol, there's no need to retry. Chances are, it won't suddenly be supported between retry attempts; error instead. Otherwise, you see something like the following: $ nix-env -i -f git://git@github.com/foo/bar warning: unable to download 'git://git@github.com/foo/bar': Unsupported protocol (1); retrying in 335 ms warning: unable to download 'git://git@github.com/foo/bar': Unsupported protocol (1); retrying in 604 ms warning: unable to download 'git://git@github.com/foo/bar': Unsupported protocol (1); retrying in 1340 ms warning: unable to download 'git://git@github.com/foo/bar': Unsupported protocol (1); retrying in 2685 ms With this change, you now see: $ nix-env -i -f git://git@github.com/foo/bar error: unable to download 'git://git@github.com/foo/bar': Unsupported protocol (1) (cherry picked from commit c976cb0b8ab5d0f2c4ab8c9826fc7db56e2f1b3e) Signed-off-by: Domen Kožar <domen@dev.si>
2020-04-10 Downloader: Only write data to the sink on a 200 responseEelco Dolstra1-2/+9
Hopefully fixes #3278. (cherry picked from commit 1ab8d6ac1861e9405ae34af3deb681020c03e82d) Signed-off-by: Domen Kožar <domen@dev.si>
2020-03-13 style.css: RemoveEelco Dolstra2-265/+1
This file is licensed under the GPL. Originally, Nix was also GPL-licensed so that was fine. However, we later changed the license to the LGPL but missed the fact that style.css has an incompatible license. Since the Nix manual at nixos.org uses its own styling, we can remove this file. Fixes #3392. (cherry picked from commit 9c7e90f414067eb59170bde952d5b8ac03c8f46c)
2020-03-13 mk/README.md: RemoveEelco Dolstra1-6/+0
The make-rules repo is not maintained. (cherry picked from commit cc5c81822d298544489ea0861d266c3a5137759a)
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-02-18 Build with large config Boehm GCEelco Dolstra3-4/+12
(cherry picked from commit 583d06385de82ab5c7fc77d26cd138d3c6d5f4b5)
2020-02-18 Enable debug symbolsEelco Dolstra1-0/+2
(cherry picked from commit f46bc0e8eb079f7d2613bfabfbcff31f4401b42c)
2020-02-18 Disable shellcheckEelco Dolstra1-1/+1
It's broken at the moment: https://hydra.nixos.org/build/105746055 Also it pulls in GHC which is a pretty big dependency. (cherry picked from commit b4e260d887441fde9ab568dff7c21a77d7cff904)
2020-02-18 doc: touchup release notes for 2.3Benjamin Hipple1-8/+7
- At the top of the release notes, we announce sandboxing is now enabled by default, then at the bottom it says it's now disabled when missing kernel support. These can be merged into one point for clarity. - The point about `max-jobs` defaulting to 1 appears unrelated to sandboxing. (cherry picked from commit 5d24e18e29ea1fff8fa316701fd95be6941da770)
2020-02-18 structured-attrs: chown .attrs.* files to builderRobin Gloster1-0/+2
Otherwise `chmod .`'ing the build directory doesn't work anymore, which is done in nixpkgs if sourceRoot is set to '.'. (cherry picked from commit f8dbde0813c4e8beed6dfd09b093589e027a6675)
2020-02-18 retry on HTTP status code 429Domen Kožar1-1/+2
(cherry picked from commit 48ddb8e481c0ba0b59b7193df4aa914ce83a9032)
2020-02-18 Bump version numberEelco Dolstra1-1/+1
2020-01-05 Move #includeEelco Dolstra3-2/+3
(cherry picked from commit 8beedd44861d1fe7208609ee8d231ca1c02dedf6) (cherry picked from commit 0678e4d56a839f940af8aa70059ced48b393e817)
2020-01-05 Hide FunctionCallTrace constructor/destructorEelco Dolstra3-15/+20
This prevents them from being inlined. On gcc 9, this reduces the stack size needed for nix-instantiate '<nixpkgs>' -A texlive.combined.scheme-full --dry-run from 12.9 MiB to 4.8 MiB. (cherry picked from commit cb90e382b5b6e177ea902b3909fd1897643ae3cd)
2020-01-05 function-trace: always show the tracezimbatm3-6/+4
If the user invokes nix with --trace-function-calls it means that they want to see the trace. (cherry picked from commit 619cc4af855fab7b0400586a4fd40745b23e72ad)
2020-01-04 .version: Remove newlineEelco Dolstra1-1/+1
2020-01-04 Document builtins.placeholderArnout Engelen1-0/+10
(cherry picked from commit 4e70652ee33641a6cfddbfb9b7d741515f1bf98a)
2020-01-04 Add testcase for attrset using __overrides and dynamic attrsPuck Meerburg2-0/+5
(cherry picked from commit cdadbf770855e828a0f64d70a47db43e920ad137)
2020-01-04 Ensure enough space in attrset bindings when using both __overrides and ↵Puck Meerburg1-1/+1
dynamic attributes (cherry picked from commit cd55f91ad2075d5ebb506950dfbc4161cab22db5)
2020-01-04 doc: Document `--dry-run` option for `nix-build`Maximilian Bosch1-0/+5
(cherry picked from commit 52ffe2797a6a943bac968e92ad443a567dfdf80e)
2020-01-04 docs: correct default location of log directoryKevin Stock1-1/+1
(cherry picked from commit cea05e5ee758daad40047db0b861980d80da2e85)
2020-01-04 builtins.toJSON: fix __toString usageRobin Gloster5-8/+29
(cherry picked from commit e583df52800b4baa1564b027fe3b83a21756c2cc)
2020-01-04 install-multi-user.sh: Remove unused variablesEelco Dolstra1-3/+0
https://hydra.nixos.org/build/104119659 (cherry picked from commit 2f96a89646c6e55e2f1bbb80805dcbbe60fa94ae)
2020-01-04 Remove superfluous IAM action for S3 cacheChaz Schlarp1-1/+0
`s3:ListObjects` isn't a real IAM action, but _is_ the name of an S3 API method. `s3:ListBucket` is the relevant action for that method. https://docs.aws.amazon.com/IAM/latest/UserGuide/list_amazons3.html (cherry picked from commit c92ea927e508f3c06b6b3ee68e1f0565264cac2c)
2020-01-04 Tweak path hintErsin Akinci1-1/+2
(cherry picked from commit f107a270026596e525bdf8df0e2d331783ec4a10)
2020-01-04 Add hint about path in builtins.importErsin Akinci1-0/+4
(cherry picked from commit b7a936224ee6e1ad9c842f618bbd5bc1864ebd54)
2020-01-04 Revert "Document import <path> syntax"Ersin Akinci1-9/+1
This reverts commit d8730fb86facadbef22d3df7f8a743a56e7ed53c. (cherry picked from commit 9be7787ec04d604a4e65a22a6b9ae56567aaf618)
2020-01-04 Fix unset variable in installerSteven Shaw1-4/+1
(cherry picked from commit f0ec4b4ce478a8d2760203e8192275b88c770e1c)
2020-01-04 Make nix-daemon.plist less fragile on macOSDan Callahan1-1/+1
We're calling `wait4path` on the full, resolved `@bindir@/nix-daemon` path. That means we're hardcoding something like: /bin/wait4path /nix/store/zs9c5xhp3zv9p23qnjxp87nl5injsi1i-nix-2.3/bin/nix-daemon &amp;&amp; /nix/var/nix/profiles/default/bin/nix-daemon That seems unnecessarily fragile. It might be better to wait4path on the path we intend to call. (cherry picked from commit 8c4a5e7ba1990348b9497c0fc4dc236dda3e7986)
2020-01-04 Copy instead of linking launch agentMatthew Bauer2-2/+2
On Catalina, the /nix filesystem might not be mounted at start time. To avoid this service not starting, we need to keep the launch agent outside of the Nix store. A wait4pid will hold for our /nix dir to be mounted. Fixes #3125. (cherry picked from commit 0847f2f1b3145a62dc34707ba788275ce6b6fc57)
2020-01-04 Bump version numberEelco Dolstra1-1/+1
2020-01-04 Disable the evalNixOS testEelco Dolstra1-2/+2
It also OOMs. https://hydra.nixos.org/build/105942679 (cherry picked from commit 99af822004418b25b6d04eca67949c62e770c16b)
2020-01-04 Disable the evalNixpkgs testEelco Dolstra1-1/+3
It constantly OOMs. https://hydra.nixos.org/build/105784912 (cherry picked from commit 35732a95bcdc0a4b4492845205e6283fcc88fd0d)
2020-01-04 Move tmpDirInSandbox to initTmpDirMatthew Bauer1-8/+8
(cherry picked from commit 96c84937c49435525d0733437aa88902b2c8caf6)
2020-01-04 Fix sandbox fallback settingsMatthew Bauer1-26/+34
The tmpDirInSandbox is different when in sandboxed vs. non-sandboxed. Since we don’t know ahead of time here whether sandboxing is enabled, we need to reset all of the env vars we’ve set previously. This fixes the issue encountered in https://github.com/NixOS/nixpkgs/issues/70856. (cherry picked from commit 499b0388759db0f9f385da402a4bba551268aa99)
2020-01-04 ssh-ng: Don't set CPU affinity on the remoteEelco Dolstra3-1/+9
Fixes #3138. (cherry picked from commit 906d56a96b442d4dd8f924c1ce0d1eec0e214af3)
2020-01-04 SourceExprCommand::getSourceExpr(): Allocate more spaceEelco Dolstra1-1/+1
Fixes #3140. (cherry picked from commit 389a2cebed7cd72bda524ece0a56af2888cd80b6)
2020-01-04 Document import <path> syntaxErsin Akinci1-1/+9
(cherry picked from commit d8730fb86facadbef22d3df7f8a743a56e7ed53c)
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 Dijk2-2/+2
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)
2020-01-04 Fix typosBrian Wignall2-2/+2
(cherry picked from commit 8737980e75bf14cae278f596ac26577bec94b3f9)
2020-01-04 EvalState::callFunction(): Make FunctionCallTrace use less stack spaceEelco Dolstra1-4/+3
The FunctionCallTrace object consumes a few hundred bytes of stack space, even when tracing is disabled. This was causing stack overflows: $ nix-instantiate '<nixpkgs> -A texlive.combined.scheme-full --dry-run error: stack overflow (possible infinite recursion) This is with the default stack size of 8 MiB. Putting the object on the heap reduces stack usage to < 5 MiB. (cherry picked from commit 98ef11677c43db9aa669768d9f0cbec704e8831c)