nix-build
/ nix-instantiate
will silently ignore unknown arguments being passed with --arg
#865
Labels
No labels
Affects/CppNix
Affects/Nightly
Affects/Only nightly
Affects/Stable
Area/build-packaging
Area/cli
Area/evaluator
Area/fetching
Area/flakes
Area/language
Area/lix ci
Area/nix-eval-jobs
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/repl/debugger
Area/store
bug
Context
contributors
Context
drive-by
Context
maintainers
Context
RFD
crash 💥
Cross Compilation
devx
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
imported
Language/Bash
Language/C++
Language/NixLang
Language/Python
Language/Rust
Needs Langver
OS/Linux
OS/macOS
performance
regression
release-blocker
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
Topic/Large Scale Installations
ux
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lix-project/lix#865
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Describe the bug
Imagine you have:
{ }: true
as a file.You do:
nix-build --arg something true
on that file and you expect to get an error because you are passing an argument that doesn't exist.But, you do not.
Steps To Reproduce
{ }: true
indefault.nix
nix-instantiate --arg something true --eval -f default.nix
true
being returnedExpected behavior
nix --version
outputLix 2.94.0-dev.
Happens also in CppNix.
Additional context
This caused a silent bug in the functional1 test suite with non-UTF8 inodes, I passed the wrong argument
nonUtf8Inode
instead ofnonUtf8Inodes
and generated NO non-UTF8 inodes.Tough luck.
This issue was mentioned on Gerrit on the following CLs:
This is because of autocall, which is really jank. I think if we wanted to fix this, we could track what was autocalled and what with and then generate a diagnostic if an input was never used. It's plausible that we can't make this a hard error as autocall is at any level: lix tries to call every function it runs into with the given arg in a kind of sketchy way, so it's very possible that a lot of people are relying on this unfortunate design.
That doesn't sound like it is unreasonable to emit a diagnostic for in nearly every case, unless people have come up not just relying on this behavior by accident, but as intentional design (ie, they would get spammed with warnings from that).
There is however the question, do we want people to rely on this design? Can we come up with a timeline along which we can eventually turn that diagnostic into a hard error, even if it is going to sometimes painful as we only know it at the far end of eval that we have not consumed all the args.
I don't think this is the first bug report about autocall either, pennae thinks it's evil and it's been on their shit list forever. The last one I'm thinking of is relating to --arg and --expr not liking each other iirc
#263 pawhaps
lol this is a duplicate #775 (comment)
--arg
to never apply, generating no warnings #775