nix-shell
may explode in flight because /tmp/env-vars
exist if you have no $TMPDIR
set #940
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#940
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
nixpkgs stdenv has a phase load-bearing which is to dump
env-vars
in the$NIX_BUILD_TOP
, in case, this is not possible, this explodes.This is ironic because
dumpVars
is meant as a debugging tool but can take down your shell.Nixpkgs could be slightly more lenient here and warn if dumpVars failed without crashing your shell.
In the meantime, Lix could probably do something better at picking
$NIX_BUILD_TOP
.Steps To Reproduce
touch /tmp/env-vars
as rootTMPDIR="" nix-shell -p gcc
Expected behavior
Warnings, error messages, and maybe a better choice of
$TMPDIR
fallback?nix --version
outputProbably all Nix versions.
Additional context
Debugged with the help of @lheckemann
Isn't this fixed in nix3-develop? I'm pretty sure the latter gives a unique tmpdir for each shell or so.
i don't use nix3-develop but that might be possibly the case
lol yeah I'm just pointing out that you could probably steal the code that works
FWIW I think the
nix develop
code is quite buggy in its own right, for a long time it triggered https://github.com/NixOS/nix/issues/10753 because it put you in a tempdir with different permissions. But it would be good if the two (nix-shell and nix3-develop) were consistent.This issue was mentioned on Gerrit on the following CLs: