Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evaluation dependence on external tools: docs, purity, fallbacks #1833

Open
dtzWill opened this issue Feb 1, 2018 · 4 comments
Open

Evaluation dependence on external tools: docs, purity, fallbacks #1833

dtzWill opened this issue Feb 1, 2018 · 4 comments
Assignees
Labels
language The Nix expression language; parser, interpreter, primops, evaluation, etc UX The way in which users interact with Nix. Higher level than UI.

Comments

@dtzWill
Copy link
Member

dtzWill commented Feb 1, 2018

Various functionality provided by Nix tools and builtins relies on the presence and "correct" functionality of external tools.

This seems... unfortunate 😇 .

The biggest issue is one of simple usability: evaluation failures due to missing tools are a bad experience and it's not always obvious, trivial, or convenient to manipulate the environment of the Nix-based process you're interacting with to properly resolve them.

As an example, nix-based services (such as the auto-upgrader) will fail to evaluate expressions using builtins.fetchGit and fixing it requires modifying the service configuration to add required tools to the service's PATH.

Additional related issues:

  • The full list of tools required to make use of builtin Nix functionality is not available AFAICT (although this is easily fixed)
  • Reliance on these tools makes Nix evaluation "brittle" in a very (IMHO) non-Nix way--consider attempting to use Nix itself in a sandbox.
  • Reliability and purity: tools found may have different behavior than those expected and tested against (newer, older, bugged, malicious replacements).

I'm not sure of the best solution here, especially considering concerns about closure size and ease of deployment (being self-contained is rather useful here).

It's not perfect but best proposal I have is to replace all external programs with use of (mandatory?) libraries.

Thoughts? :)

@lheckemann
Copy link
Member

As a sort of compromise, maybe we could produce wrappers for nix that set add the appropriate tools to PATH, and make the default nix in nixpkgs such a wrapped one? This would allow a reduced closure size while enabling all the functionality to work by default.

@copumpkin
Copy link
Member

I submitted this a while back, which could be relevant: #1345

@copumpkin
Copy link
Member

One thing that might be nice is a first-class building block for optional external dependencies in Nix code, that would let us enumerate them and detect early if they're available or not, to emit warnings/errors.

@stale
Copy link

stale bot commented Feb 14, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Feb 14, 2021
@fricklerhandwerk fricklerhandwerk added UX The way in which users interact with Nix. Higher level than UI. language The Nix expression language; parser, interpreter, primops, evaluation, etc and removed stale labels Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language The Nix expression language; parser, interpreter, primops, evaluation, etc UX The way in which users interact with Nix. Higher level than UI.
Projects
None yet
Development

No branches or pull requests

6 participants