Skip to content

fix(apply): fix resultLocation variable shadowing in build path#169

Merged
water-sucks merged 1 commit intonix-community:mainfrom
unhitched9271:main
Feb 7, 2026
Merged

fix(apply): fix resultLocation variable shadowing in build path#169
water-sucks merged 1 commit intonix-community:mainfrom
unhitched9271:main

Conversation

@unhitched9271
Copy link
Copy Markdown
Contributor

The := operator was creating a new local resultLocation variable
inside the if block, leaving the outer variable empty (""). This
caused the diff command to receive an empty path:

 $ nvd diff /run/current-system
 error: a value is required for '\''[AFTER]'\'' but none was supplied

Changed := to = with a pre-declared err variable so the build
result path correctly assigns to the outer resultLocation.

   The := operator was creating a new local resultLocation variable
   inside the if block, leaving the outer variable empty (""). This
   caused the diff command to receive an empty path:

     $ nvd diff /run/current-system
     error: a value is required for '\''[AFTER]'\'' but none was supplied

   Changed := to = with a pre-declared err variable so the build
   result path correctly assigns to the outer resultLocation.
@water-sucks water-sucks changed the title fix(apply): fix resultLocation variable shadowing in build path - which causes " 3. Comparing changes... error: a value is required for '[AFTER]' but none was supplied For more information, try '--help'. error: failed to run diff command: exit status 2" fix(apply): fix resultLocation variable shadowing in build path Feb 7, 2026
Copy link
Copy Markdown
Collaborator

@water-sucks water-sucks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for catching this! This slipped past past me when reviewing/testing somehow.

@water-sucks water-sucks merged commit 52826ae into nix-community:main Feb 7, 2026
2 checks passed
@Sporif
Copy link
Copy Markdown
Collaborator

Sporif commented Feb 8, 2026

Oof, sorry about that. Strangely, go warned me about this in an earlier version, but later somehow didn't...

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.

3 participants