functional2: hermatic env / overhaul Command
environment #847
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lix-project/lix#847
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?
Is your feature request related to a problem? Please describe.
Currently, when using
Nix
, it creates a "hermetic_env
" to set up config and prevent leakage from the global config.The described env is neither complete nor hermetic at all, which causes tests to fail (e.g. https://gerrit.lix.systems/c/lix/+/3266/2)
Additionally, the paths it sets, aren't created, which leads to them being invalid, causing flakynes elsewhere.
Describe the solution you'd like
The creation and setup of the test environment should be moved to the
Command
class.As we rely on the
tmp_path
for setting some of the variables, a full rework is likely needed to get access to said information. This could be done similar to howNix
acquires the information currently.Additionally, using
os.environ
should be disallowed. For some tests to still be able to access the systemPATH
(esp builders), there should either be an option to inheritPATH
or to provide a specific program to add toPATH
(preferred; could be determined usingshutil.which()
)The new
Command
should also offer an interface for setting and also unsetting (which is currenlty not possible) singular environment variables.Describe alternatives you've considered
It was dicussed in the lix-dev matrix channel to move environment handling to
NixCommand
instead, but was decided against to make all command executions consistent and ensure no configuration leakage when usingCommand
.Additional context
insert list of environment variables, directories and files created by the functional runner here when done compiling
This issue was mentioned on Gerrit on the following CLs: