aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2021-01-25Tell user to run 'nix log' to get full build logsEelco Dolstra
2021-01-25Add FIXMEEelco Dolstra
2021-01-25Make '--help' do the same as 'help' (i.e. show a manpage)Eelco Dolstra
2021-01-25Merge pull request #4467 from edolstra/error-formattingEelco Dolstra
Improve error formatting
2021-01-25Merge pull request #4470 from matthewbauer/fix-4469Eelco Dolstra
Handle missing etag in 304 Not Modified response
2021-01-25Merge pull request #4387 from obsidiansystems/non-local-store-buildEelco Dolstra
Make `nix-build --store whatever` work
2021-01-22Remove expectedETag assert in tarball.ccMatthew Bauer
2021-01-22Handle missing etag in 304 Not Modified responseMatthew Bauer
GitHub now omits the etag, but 304 implies it matches the one we provided. Just use that one to avoid having an etag-less resource. Fixes #4469
2021-01-22Apply suggestions from code reviewJohn Ericson
Thanks! Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2021-01-22Improve documentation and test and requestedJohn Ericson
2021-01-22Add FIXMEEelco Dolstra
2021-01-21Fix macOS buildEelco Dolstra
2021-01-21Change error position formattingEelco Dolstra
It's now at /home/eelco/Dev/nixpkgs/pkgs/applications/misc/hello/default.nix:7:7: instead of at: (7:7) in file: /home/eelco/Dev/nixpkgs/pkgs/applications/misc/hello/default.nix The new format is more standard and clickable.
2021-01-21Remove trailing whitespaceEelco Dolstra
2021-01-21Improve error formattingEelco Dolstra
Changes: * The divider lines are gone. These were in practice a bit confusing, in particular with --show-trace or --keep-going, since then there were multiple lines, suggesting a start/end which wasn't the case. * Instead, multi-line error messages are now indented to align with the prefix (e.g. "error: "). * The 'description' field is gone since we weren't really using it. * 'hint' is renamed to 'msg' since it really wasn't a hint. * The error is now printed *before* the location info. * The 'name' field is no longer printed since most of the time it wasn't very useful since it was just the name of the exception (like EvalError). Ideally in the future this would be a unique, easily googleable error ID (like rustc). * "trace:" is now just "…". This assumes error contexts start with something like "while doing X". Example before: error: --- AssertionError ---------------------------------------------------------------------------------------- nix at: (7:7) in file: /home/eelco/Dev/nixpkgs/pkgs/applications/misc/hello/default.nix 6| 7| x = assert false; 1; | ^ 8| assertion 'false' failed ----------------------------------------------------- show-trace ----------------------------------------------------- trace: while evaluating the attribute 'x' of the derivation 'hello-2.10' at: (192:11) in file: /home/eelco/Dev/nixpkgs/pkgs/stdenv/generic/make-derivation.nix 191| // (lib.optionalAttrs (!(attrs ? name) && attrs ? pname && attrs ? version)) { 192| name = "${attrs.pname}-${attrs.version}"; | ^ 193| } // (lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform && !dontAddHostSuffix && (attrs ? name || (attrs ? pname && attrs ? version)))) { Example after: error: assertion 'false' failed at: (7:7) in file: /home/eelco/Dev/nixpkgs/pkgs/applications/misc/hello/default.nix 6| 7| x = assert false; 1; | ^ 8| … while evaluating the attribute 'x' of the derivation 'hello-2.10' at: (192:11) in file: /home/eelco/Dev/nixpkgs/pkgs/stdenv/generic/make-derivation.nix 191| // (lib.optionalAttrs (!(attrs ? name) && attrs ? pname && attrs ? version)) { 192| name = "${attrs.pname}-${attrs.version}"; | ^ 193| } // (lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform && !dontAddHostSuffix && (attrs ? name || (attrs ? pname && attrs ? version)))) {
2021-01-21narinfo: Change NAR URLs to be addressed on the NAR hash instead of the ↵adisbladis
compressed hash This change is to simplify [Trustix](https://github.com/tweag/trustix) indexing and makes it possible to reconstruct this URL regardless of the compression used. In particular this means that https://github.com/tweag/trustix/blob/7c2e9ca597de233846e0b265fb081626ca6c59d8/contrib/nix/nar/nar.go#L61-L71 can be removed and only the bits that are required to establish trust needs to be published in the Trustix build logs.
2021-01-21Fix clang buildEelco Dolstra
2021-01-20Merge pull request #4281 from lilyball/shebangEelco Dolstra
Escape filename given to nix-shell in shebang mode
2021-01-18nix profile install: Support installing non-flakesEelco Dolstra
Fixes #4458.
2021-01-18Use enumerate()Eelco Dolstra
2021-01-18--refresh: Imply setting .narinfo disk cache TTL to 0Eelco Dolstra
2021-01-18Merge branch 'slashes-in-github-branches' of https://github.com/Ma27/nixEelco Dolstra
2021-01-18Fix content-addressed flake outputsregnat
Prevent some `nix flake` commands to crash by trying to parse a placeholder output as a store path
2021-01-18Fix the drv output map for non ca derivationsregnat
With the `ca-derivation` experimental features, non-ca derivations used to have their output paths returned as unknown as long as they weren't built (because of a mistake in the code that systematically erased the previous value)
2021-01-17TweakEelco Dolstra
2021-01-16Document expected output of 'nix store ping'.ryneeverett
While interpreting the output is fairly intuitive it would be better to explicitly specify what a good invocation looks like. That this isn't completely obvious (or at least causes folks to second-guess themselves) can be seen in a couple user threads: - https://discourse.nixos.org/t/nixos-cache-fetching-issue/3575/11 - https://discourse.nixos.org/t/newbie-question-cant-get-trivial-example-of-nixops-to-work-on-my-mac/1125/8
2021-01-15Merge pull request #4240 from bburdette/2259-error-messageDomen Kožar
2259 error message - "auto-call" error
2021-01-15Make public keys and `requireSigs` local-store specific againJohn Ericson
Thanks @regnat and @edolstra for catching this and comming up with the solution. They way I had generalized those is wrong, because local settings for non-local stores is confusing default. And due to the nature of C++ inheritance, fixing the defaults is more annoying than it should be. Additionally, I thought we might just drop the check in the substitution logic since `Store::addToStore` is now streaming, but @regnat rightfully pointed out that as it downloads dependencies first, that would still be too late, and also waste effort on possibly unneeded/unwanted dependencies. The simple and correct thing to do is just make a store method for the boolean logic, keeping all the setting and key stuff the way it was before. That new method is both used by `LocalStore::addToStore` and the substitution goal check. Perhaps we might eventually make it fancier, e.g. sending the ValidPathInfo to remote stores for them to validate, but this is good enough for now.
2021-01-15Fix gcc10 buildJonathan Ringer
2021-01-15Merge remote-tracking branch 'upstream/master' into non-local-store-buildJohn Ericson
2021-01-14Add 'nix daemon' commandEelco Dolstra
2021-01-13TypoEelco Dolstra
2021-01-13Rename 'nix store sign-paths' to 'nix store sign'Eelco Dolstra
2021-01-13Add 'nix store repair' commandEelco Dolstra
2021-01-13Convert option descriptions to MarkdownEelco Dolstra
2021-01-13Merge pull request #4444 from matthewbauer/unset-curproc-arch-affinityEelco Dolstra
Set kern.curproc_arch_affinity=0 to escape Rosetta
2021-01-13Merge pull request #4443 from rickynils/prefer-local-build-respect-zero-max-jobsEelco Dolstra
Don't let 'preferLocalBuild' override 'max-jobs=0'
2021-01-13Remove a redundant condition in DerivationGoal::tryLocalBuild()Rickard Nilsson
2021-01-12Add 'nix profile history' commandEelco Dolstra
Replaces 'nix-env --list-generations'. Similar to 'nix profile diff-closures' but shows only the changes in top-level packages.
2021-01-12nix profile info -> nix profile listEelco Dolstra
2021-01-11Set kern.curproc_arch_affinity=0 to escape RosettaMatthew Bauer
By default, once you enter x86_64 Rosetta 2, macOS will try to run everything in x86_64. So an x86_64 Nix will still try to use x86_64 even when system = aarch64-darwin. To avoid this we can set kern.curproc_arch_affinity sysctl. With kern.curproc_arch_affinity=0, we ignore this preference. This is based on how https://opensource.apple.com/source/system_cmds/system_cmds-880.40.5/arch.tproj/arch.c.auto.html works. Completely undocumented, but seems to work! Note, you can verify this works with this impure Nix expression: ``` { a = derivation { name = "a"; system = "aarch64-darwin"; builder = "/bin/sh"; args = [ "-e" (builtins.toFile "builder" '' [ "$(/usr/bin/arch)" = arm64 ] [ "$(/usr/bin/arch -arch x86_64 /bin/sh -c /usr/bin/arch)" = i386 ] [ "$(/usr/bin/arch -arch arm64 /bin/sh -c /usr/bin/arch)" = arm64 ] /usr/bin/touch $out '') ]; }; b = derivation { name = "b"; system = "x86_64-darwin"; builder = "/bin/sh"; args = [ "-e" (builtins.toFile "builder" '' [ "$(/usr/bin/arch)" = i386 ] [ "$(/usr/bin/arch -arch x86_64 /bin/sh -c /usr/bin/arch)" = i386 ] [ "$(/usr/bin/arch -arch arm64 /bin/sh -c /usr/bin/arch)" = arm64 ] /usr/bin/touch $out '') ]; }; } ```
2021-01-12Don't let 'preferLocalBuild' override 'max-jobs=0'Rickard Nilsson
This resolves #3810 by changing the behavior of `max-jobs = 0`, so that specifying the option also avoids local building of derivations with the attribute `preferLocalBuild = true`.
2021-01-11Add 'nix store delete' commandEelco Dolstra
2021-01-11nix store prefetch-tarball -> nix flake prefetchEelco Dolstra
2021-01-11Merge pull request #4435 from DanilaFe/flake-input-typesEelco Dolstra
Allow Flake inputs to accept boolean and integer attributes
2021-01-10Add 'nix store gc' commandEelco Dolstra
2021-01-08Upcase "Boolean" in Flake attribute type errorDanila
Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2021-01-08Fix testsEelco Dolstra
2021-01-08Support binary unit prefixes in command line argumentsEelco Dolstra
2021-01-08string2Int(): Return std::optionalEelco Dolstra