nix icon indicating copy to clipboard operation
nix copied to clipboard

AttrCursor: Remove forceErrors

Open edolstra opened this issue 1 year ago • 3 comments

Motivation

This should remove all "cached failure of attribute X" messages by forcing evaluation of the original value when it's needed to show the exception to the user.

Context

Priorities and Process

Add :+1: to pull requests you find important.

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

edolstra avatar Apr 19 '24 17:04 edolstra

Actually I am not longer able to reproduce the eval error with nix 2.22.0, also it happens for nix 2.18. Also the test you wrote works even if the fix is not applied.

Mic92 avatar May 17 '24 19:05 Mic92

@Mic92 I can't reproduce that. The test does fail for me without the fix:

    +(eval-cache.sh:21) expect 1 nix build /tmp/nix-shell.vnDGIZ/nix-test/flakes/eval-cache/eval-cache-flake#foo.bar
    +(eval-cache.sh:21) grepQuiet 'error: breaks'
    +(/home/eelco/Dev/nix-master/tests/functional/common/vars-and-functions.sh:279) grep 'error: breaks'
    +(eval-cache.sh:22) grepQuiet 'error: breaks'
    +(/home/eelco/Dev/nix-master/tests/functional/common/vars-and-functions.sh:279) grep 'error: breaks'
    +(eval-cache.sh:22) expect 1 nix build /tmp/nix-shell.vnDGIZ/nix-test/flakes/eval-cache/eval-cache-flake#foo.bar
    ++(eval-cache.sh:22) onError
    ++(/home/eelco/Dev/nix-master/tests/functional/common/vars-and-functions.sh:250) set +x
    eval-cache.sh: test failed at:
      main in eval-cache.sh:22

edolstra avatar May 24 '24 14:05 edolstra

@Mic92 I can't reproduce that. The test does fail for me without the fix:

    +(eval-cache.sh:21) expect 1 nix build /tmp/nix-shell.vnDGIZ/nix-test/flakes/eval-cache/eval-cache-flake#foo.bar
    +(eval-cache.sh:21) grepQuiet 'error: breaks'
    +(/home/eelco/Dev/nix-master/tests/functional/common/vars-and-functions.sh:279) grep 'error: breaks'
    +(eval-cache.sh:22) grepQuiet 'error: breaks'
    +(/home/eelco/Dev/nix-master/tests/functional/common/vars-and-functions.sh:279) grep 'error: breaks'
    +(eval-cache.sh:22) expect 1 nix build /tmp/nix-shell.vnDGIZ/nix-test/flakes/eval-cache/eval-cache-flake#foo.bar
    ++(eval-cache.sh:22) onError
    ++(/home/eelco/Dev/nix-master/tests/functional/common/vars-and-functions.sh:250) set +x
    eval-cache.sh: test failed at:
      main in eval-cache.sh:22

Ok. I was able to reproduce this now as well: https://github.com/NixOS/nix/pull/10813

Mic92 avatar May 31 '24 09:05 Mic92

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/2024-06-03-nix-team-meeting-minutes-149/46582/1

nixos-discourse avatar Jun 06 '24 08:06 nixos-discourse

Backport failed for 2.22-maintenance, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin 2.22-maintenance
git worktree add -d .worktree/backport-10564-to-2.22-maintenance origin/2.22-maintenance
cd .worktree/backport-10564-to-2.22-maintenance
git switch --create backport-10564-to-2.22-maintenance
git cherry-pick -x 8b86f415c1a8565085e70475933e459a29d67283 2c88930ef298f6804eb9c064ca918aef01fcd2e3 eeb4c408670a6037bd4085fde654bf4a5945c4c7

github-actions[bot] avatar Jul 28 '24 14:07 github-actions[bot]

Backport failed for 2.22-maintenance, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin 2.22-maintenance
git worktree add -d .worktree/backport-10564-to-2.22-maintenance origin/2.22-maintenance
cd .worktree/backport-10564-to-2.22-maintenance
git switch --create backport-10564-to-2.22-maintenance
git cherry-pick -x 8b86f415c1a8565085e70475933e459a29d67283 2c88930ef298f6804eb9c064ca918aef01fcd2e3 eeb4c408670a6037bd4085fde654bf4a5945c4c7

github-actions[bot] avatar Jul 28 '24 14:07 github-actions[bot]

Backport failed for 2.23-maintenance, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin 2.23-maintenance
git worktree add -d .worktree/backport-10564-to-2.23-maintenance origin/2.23-maintenance
cd .worktree/backport-10564-to-2.23-maintenance
git switch --create backport-10564-to-2.23-maintenance
git cherry-pick -x 8b86f415c1a8565085e70475933e459a29d67283 2c88930ef298f6804eb9c064ca918aef01fcd2e3 eeb4c408670a6037bd4085fde654bf4a5945c4c7

github-actions[bot] avatar Jul 28 '24 14:07 github-actions[bot]

Backport failed for 2.23-maintenance, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin 2.23-maintenance
git worktree add -d .worktree/backport-10564-to-2.23-maintenance origin/2.23-maintenance
cd .worktree/backport-10564-to-2.23-maintenance
git switch --create backport-10564-to-2.23-maintenance
git cherry-pick -x 8b86f415c1a8565085e70475933e459a29d67283 2c88930ef298f6804eb9c064ca918aef01fcd2e3 eeb4c408670a6037bd4085fde654bf4a5945c4c7

github-actions[bot] avatar Jul 28 '24 14:07 github-actions[bot]