aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr
AgeCommit message (Collapse)Author
2021-03-26Fix some typosEelco Dolstra
Fixes #4671.
2021-03-03nix repl :doc: Don't return docs for partially applied primopsEelco Dolstra
This gives misleading results for Nixpkgs functions like lib.toUpper. Fixes #4596.
2021-02-22Make missing auto-call arguments throw an eval errorregnat
The PR #4240 changed messag of the error that was thrown when an auto-called function was missing an argument. However this change also changed the type of the error, from `EvalError` to a new `MissingArgumentError`. This broke hydra which was relying on an `EvalError` being thrown. Make `MissingArgumentError` a subclass of `EvalError` to un-break hydra.
2021-02-22Tweak error messageEelco Dolstra
2021-02-03Include note about type of catched errors in tryEval documentationsternenseemann
Reference #356.
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-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-25Group common optionsEelco Dolstra
2021-01-25Add FIXMEEelco 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-15Merge pull request #4240 from bburdette/2259-error-messageDomen Kožar
2259 error message - "auto-call" error
2021-01-15Fix gcc10 buildJonathan Ringer
2021-01-13Convert option descriptions to MarkdownEelco Dolstra
2021-01-11Merge pull request #4435 from DanilaFe/flake-input-typesEelco Dolstra
Allow Flake inputs to accept boolean and integer attributes
2021-01-08Upcase "Boolean" in Flake attribute type errorDanila
Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2021-01-08string2Int(): Return std::optionalEelco Dolstra
2021-01-08Use switch statement instead of sequence of ifsDanila Fedorin
2021-01-08Allow Flake inputs to accept boolean and integer attributesDanila Fedorin
I believe that this makes it possible to do things like Git inputs with submodules, but it also likely applies to other input types from libfetchers.
2020-12-28FixupMatthew Bauer
2020-12-24Merge branch 'master' into support-libcxx10Matthew Bauer
2020-12-23Cast variants fully for libc++10Matthew Bauer
libc++10 seems to be stricter on what it allows in variant conversion. I'm not sure what the rules are here, but this is the minimal change needed to get through the compilation errors.
2020-12-22Merge branch 'git-rev-error' of https://github.com/Ma27/nix into masterEelco Dolstra
2020-12-22Move <nix/fetchurl.nix> into the nix binaryEelco Dolstra
This makes the statically linked nix binary just work, without needing any additional files.
2020-12-22Document `allRefs` argument of `builtins.fetchTree`Maximilian Bosch
2020-12-21Merge pull request #4355 from Infinisil/private-value-typeEelco Dolstra
Refactoring for private Value type
2020-12-18Replace Value type setters with mk* functionsSilvan Mosberger
Move clearValue inside Value mkInt instead of setInt mkBool instead of setBool mkString instead of setString mkPath instead of setPath mkNull instead of setNull mkAttrs instead of setAttrs mkList instead of setList* mkThunk instead of setThunk mkApp instead of setApp mkLambda instead of setLambda mkBlackhole instead of setBlackhole mkPrimOp instead of setPrimOp mkPrimOpApp instead of setPrimOpApp mkExternal instead of setExternal mkFloat instead of setFloat Add note that the static mk* function should be removed eventually
2020-12-17Rename Value::normalType() -> Value::type()Silvan Mosberger
2020-12-17Rename ValueType -> InternalType, NormalType -> ValueTypeSilvan Mosberger
And Value::type to Value::internalType, such that type() can be used in the next commit to get the new ValueType
2020-12-16Merge pull request #4348 from NixOS/ca/use-hashmoduloEelco Dolstra
Use the hash modulo in the derivation outputs
2020-12-13primops/fromJSON: add error position in case of parse errorMaximilian Bosch
This makes it easier to track down where invalid JSON was passed to `builtins.fromJSON`.
2020-12-12Make Value::type privateSilvan Mosberger
This is an implementation detail and shouldn't be used. Use normalType() and the various is<Type> functions instead
2020-12-12Add ValueType checking functions for types that have the same NormalTypeSilvan Mosberger
2020-12-12Use Value::normalType on all forced values instead of Value::typeSilvan Mosberger
2020-12-12Introduce Value type setters and make use of themSilvan Mosberger
2020-12-12Introduce NormalType for the normal type of a ValueSilvan Mosberger
This will be useful to abstract over the ValueType implementation details Make use of it already to replace the showType(ValueType) function
2020-12-11Use the hash modulo in the derivation outputsregnat
Rather than storing the derivation outputs as `drvPath!outputName` internally, store them as `drvHashModulo!outputName` (or `outputHash!outputName` for fixed-output derivations). This makes the storage slightly more opaque, but enables an earlier cutoff in cases where a fixed-output dependency changes (but keeps the same output hash) − same as what we already do for input-addressed derivations.
2020-12-03Remove 'dist' targetEelco Dolstra
We're not producing source tarballs anymore so this has been bitrotting.
2020-12-02Remove an `unknown pragma` gcc warningregnat
2020-12-01shut up clang warningsregnat
- Fix some class/struct discrepancies - Explicit the overloading of `run` in the `Cmd*` classes - Ignore a warning in the generated lexer
2020-11-26builtins.fetchGit: Fix shortRev attribute for dirty treesEelco Dolstra
2020-11-26Move to separate fileEelco Dolstra
2020-11-26Record trusted/untrusted settings in ~/.local/share/nixEelco Dolstra
2020-11-26Ask for confirmation before allowing flake Nix configuration settingsEelco Dolstra
2020-11-19AttrCursor::getStringWithContext(): Force re-evaluation if the cached ↵Eelco Dolstra
context is not valid Fixes #4236.
2020-11-19Fix assertion failure in LockFile::LockFile()Eelco Dolstra
Fixes #4241.
2020-11-19Make drv hash modulo memo table thread-safeJohn Ericson
Let's get one step closer to the daemon not needing to fork.
2020-11-17Merge pull request #4189 from edolstra/flake-configEelco Dolstra
Allow nix.conf options to be set in flake.nix
2020-11-12Fix default nix-pathChristian Höppner
The default nix-path values for nixpkgs and root channels were incorrect.
2020-11-11change messageBen Burdette
2020-11-11pare down the error messageBen Burdette