aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2021-02-07Merge pull request #4525 from sternenseemann/lowdown-0.8.0Eelco Dolstra
libcmd/markdown: handle allocation errors in lowdown_term_rndr
2021-02-07Support --no-net for backwards compatibilityEelco Dolstra
2021-02-06libcmd/markdown: handle allocation errors in lowdown_term_rndrsternenseemann
We upgrade to lowdown 0.8.0 [1] which contains a fix/improvement to a behavior mentioned in this issue thread [2] where a big part of lowdown's API would just call exit(1) on allocation errors since that is a satisfying behavior for the lowdown binary. Now lowdown_term_rndr returns 0 if an allocation error occurred which we check for in libcmd/markdown.cc. Also the extern "C" { } wrapper around lowdown.h has been removed as it is not necessary. [1]: https://github.com/kristapsdz/lowdown/blob/6ca7c855a063d1c77ae0b89405047cc3913a74d8/versions.xml#L987-L1006 [2]: https://github.com/kristapsdz/lowdown/issues/45#issuecomment-756681153
2021-02-05Add more instrumentation for #4270Eelco Dolstra
2021-02-05Merge pull request #4372 from tweag/ca/drvoutputs-commandsEelco Dolstra
Add a new Cmd type working on RealisedPaths
2021-02-05Merge pull request #4515 from matthewbauer/fix-nix-profile-install-first-outputEelco Dolstra
Use derivation output name from toDerivation
2021-02-05Add a trace to readLine() failuresEelco Dolstra
Hopefully this helps to diagnose 'error: unexpected EOF reading a line' on macOS.
2021-02-05Remove the `visit` machinery in `RealisedPath`regnat
In addition to being some ugly template trickery, it was also totally useless as it was used in only one place where I could replace it by just a few extra characters
2021-02-05Move the GENERATE_CMP macro to its own fileregnat
Despite being an ugly hack, it can probably be useful in a couple extra places
2021-02-04Fix a whitespace issueThéophane Hufschmitt
Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2021-02-04Normalize some error messagesThéophane Hufschmitt
Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2021-02-03Always enter first level of attrset in nix searchMatthew Bauer
This makes nix search always go through the first level of an attribute set, even if it's not a top level attribute. For instance, you can now list all GHC compilers with: $ nix search nixpkgs#haskell.compiler ... This is similar to how nix-env works when you pass in -A.
2021-02-03Include note about type of catched errors in tryEval documentationsternenseemann
Reference #356.
2021-02-02Use derivation output name from toDerivationMatthew Bauer
This fixes an issue where derivations with a primary output that is not "out" would fail with: $ nix profile install nixpkgs#sqlite error: opening directory '/nix/store/2a2ydlgyydly5czcc8lg12n6qqkfz863-sqlite-3.34.1-bin': No such file or directory This happens because while derivations produce every output when built, you might not have them if you didn't build the derivation yourself (for instance, the store path was fetch from a binary cache). This uses outputName provided from DerivationInfo which appears to match the first output of the derivation.
2021-02-01--no-net -> --offlineDomen Kožar
2021-01-29Merge pull request #4461 from NixOS/ca/error-logging-fixesEelco Dolstra
Fix some logging with ca derivations
2021-01-29Shorten `mktemp` flag for macOSJames Ottaway
Address `mktemp: illegal option -- -`.
2021-01-28Add a new Cmd type working on RealisedPathsregnat
Where a `RealisedPath` is a store path with its history, meaning either an opaque path for stuff that has been directly added to the store, or a `Realisation` for stuff that has been built by a derivation This is a low-level refactoring that doesn't bring anything by itself (except a few dozen extra lines of code :/ ), but raising the abstraction level a bit is important on a number of levels: - Commands like `nix build` have to query for the realisations after the build is finished which is fragile (see 27905f12e4a7207450abe37c9ed78e31603b67e1 for example). Having them oprate directly at the realisation level would avoid that - Others like `nix copy` currently operate directly on (built) store paths, but need a bit more information as they will need to register the realisations on the remote side
2021-01-27Merge pull request #4483 from shlevy/libcmdEelco Dolstra
Move command plugin interface to libnixcmd
2021-01-27Add trace to build errors during import-from-derivationEelco Dolstra
Example: error: builder for '/nix/store/9ysqfidhipyzfiy54mh77iqn29j6cpsb-failing.drv' failed with exit code 1; last 1 log lines: > FAIL For full logs, run 'nix log /nix/store/9ysqfidhipyzfiy54mh77iqn29j6cpsb-failing.drv'. … while importing '/nix/store/pfp4a4bjh642ylxyipncqs03z6kkgfvy-failing' at /nix/store/25wgzr2qrqqiqfbdb1chpiry221cjglc-source/flake.nix:58:15: 57| 58| ifd = import self.hydraJobs.broken; | ^ 59|
2021-01-27Drop trailing whitespaceEelco Dolstra
2021-01-27Add traces to errors while updating flake lock fileEelco Dolstra
Example: $ nix build --show-trace error: unable to download 'https://api.github.com/repos/NixOS/nixpkgs/commits/no-such-branch': HTTP error 422 ('') response body: { "message": "No commit found for SHA: no-such-branch", "documentation_url": "https://docs.github.com/rest/reference/repos#get-a-commit" } … while fetching the input 'github:NixOS/nixpkgs/no-such-branch' … while updating the flake input 'nixpkgs' … while updating the lock file of flake 'git+file:///home/eelco/Dev/nix'
2021-01-27Remove mkFlag()Eelco Dolstra
2021-01-26Fix the error message when a dep is missingregnat
Fix a mismatch in the errors thrown when a needed output was missing from an input derivation that was leading to a wrong and quite misleading error message
2021-01-26Make the error message for missing outputs more usefulregnat
Don't only show the name of the output, but also the derivation to which this output belongs (as otherwise it's very hard to track back what went wrong)
2021-01-26Move command plugin interface to libnixcmdShea Levy
2021-01-25Group common optionsEelco Dolstra
2021-01-25Group subcommands by categoryEelco Dolstra
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-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