Skip to content

Source path error improvements - #20

Merged
edolstra merged 13 commits into
detsys-mainfrom
map-to-original-accessors-2
Apr 1, 2025
Merged

edolstra merged 13 commits into
detsys-mainfrom
map-to-original-accessors-2

Conversation

@edolstra

@edolstra edolstra commented Apr 1, 2025 •

Copy link
Copy Markdown
Collaborator

Motivation

Based on NixOS#12532 but heavily modified.

We now "mount" the source accessors of flake inputs on top of /nix/store (i.e. the MountedSourceAccessor named storeFS). This allows error messages similar to the lazy-trees branch, i.e. referring to the original source trees (like a Git repo) instead of the store path to which the input was copied.

Context


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

edolstra added 2 commits April 1, 2025 13:11
This makes paths in error messages behave similar to lazy-trees,
e.g. instead of store paths like

       error: attribute 'foobar' missing
       at /nix/store/ddzfiipzqlrh3gnprmqbadnsnrxsmc9i-source/machine/configuration.nix:209:7:
          208|
          209|       pkgs.foobar
             |       ^
          210|     ];

you now get

       error: attribute 'foobar' missing
       at /home/eelco/Misc/eelco-configurations/machine/configuration.nix:209:7:
          208|
          209|       pkgs.foobar
             |       ^
          210|     ];
@github-actions

github-actions Bot commented Apr 1, 2025 •

Copy link
Copy Markdown

@github-actions
github-actions Bot temporarily deployed to pull request April 1, 2025 11:33 Inactive
@github-actions
github-actions Bot temporarily deployed to pull request April 1, 2025 12:43 Inactive
@github-actions
github-actions Bot temporarily deployed to pull request April 1, 2025 13:48 Inactive
@edolstra
edolstra force-pushed the map-to-original-accessors-2 branch from 1f13647 to 6d80484 Compare April 1, 2025 15:46
This way, we don't need the PathDisplaySourceAccessor source accessor
hack, since error messages are produced directly by the original
source accessor.

In fact, we don't even need to copy the inputs to the store at all, so
this gets us very close to lazy trees. We just need to know the store
path so that requires hashing the entire input, which isn't lazy. But
the next step will be to use a virtual store path that gets rewritten
to the actual store path only when needed.
@edolstra
edolstra force-pushed the map-to-original-accessors-2 branch from 6d80484 to 73b1754 Compare April 1, 2025 15:50
@github-actions
github-actions Bot temporarily deployed to pull request April 1, 2025 16:02 Inactive
@github-actions
github-actions Bot temporarily deployed to pull request April 1, 2025 19:05 Inactive
Comment thread tests/functional/flakes/source-paths.sh Outdated
@github-actions
github-actions Bot temporarily deployed to pull request April 1, 2025 21:09 Inactive
@edolstra
edolstra added this pull request to the merge queue Apr 1, 2025
Merged via the queue into detsys-main with commit 1b92e87 Apr 1, 2025
@edolstra
edolstra deleted the map-to-original-accessors-2 branch April 1, 2025 22:28
@edolstra

edolstra commented Apr 2, 2025 •

Copy link
Copy Markdown
Collaborator Author

This branch was previously deployed

1 inactive deployment
pull request — fb7bcdd5 Deployed Apr 1, 2025 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants