8000 inproc: NIX_USER_CONF_FILES is set into the environment and never restored · Issue #39 · nixidae/nixidae · GitHub
[go: up one dir, main page]

Skip to content

inproc: NIX_USER_CONF_FILES is set into the environment and never restored #39

Closed

Description

@Lillecarl

Opening one in-process session changes the environment of the whole process
permanently.

Evidence

inproc/_impl.py:259-260 assigns os.environ[NIX_USER_CONF_FILES_ENV].
Nothing restores it.

rpc/worker/_worker.py:250-251 does the same, and there it is correct and
documented: the variable is an input that Nix reads in loadConfFile, and the
worker process is disposable.

In the in-process engine the assignment outlives the session and affects any
later use of Nix in the same process.

Scope

Restore the previous value in Session.close. If the maintainer prefers to
keep the side effect, state it in the docstring of the nix_conf parameter
instead. The restore is preferred.

Files

inproc/_impl.py.

Acceptance criteria

The variable holds its value from before the session after Session.close().

Compatibility

This is a deliberate behaviour change for inproc. No caller in this repository
or in pynix relies on the variable surviving the close.

Finding F15 of CODE_IMPROVEMENT_PLAN.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    source: nanopynix

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0