Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nix
base: c5b42c5a4213
Choose a base ref
...
head repository: NixOS/nix
compare: 488a82684229
Choose a head ref
  • 5 commits
  • 35 files changed
  • 1 contributor

Commits on Jan 21, 2021

  1. Improve error formatting

    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)))) {
    edolstra committed Jan 21, 2021
    Copy the full SHA
    8d4268d View commit details
    Browse the repository at this point in the history
  2. Remove trailing whitespace

    edolstra committed Jan 21, 2021
    Copy the full SHA
    4060834 View commit details
    Browse the repository at this point in the history
  3. Change error position formatting

    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.
    edolstra committed Jan 21, 2021
    Copy the full SHA
    55849e1 View commit details
    Browse the repository at this point in the history
  4. Fix macOS build

    edolstra committed Jan 21, 2021
    Copy the full SHA
    0eb22db View commit details
    Browse the repository at this point in the history

Commits on Jan 25, 2021

  1. Merge pull request #4467 from edolstra/error-formatting

    Improve error formatting
    edolstra committed Jan 25, 2021
    Copy the full SHA
    488a826 View commit details
    Browse the repository at this point in the history