Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttrCursor: Remove forceErrors #10564

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

edolstra
Copy link
Member

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 👍 to pull requests you find important.

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

@github-actions github-actions bot added new-cli Relating to the "nix" command with-tests Issues related to testing. PRs with tests have some priority labels Apr 19, 2024
@Mic92
Copy link
Member

Mic92 commented May 17, 2024

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.

@edolstra
Copy link
Member Author

@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

Instead, force evaluation of the original value only if we need to
show the exception to the user.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-cli Relating to the "nix" command with-tests Issues related to testing. PRs with tests have some priority
Projects
Status: To triage
Development

Successfully merging this pull request may close these issues.

None yet

2 participants