1

I'm trying to understand how package managers, specifically Nix, ensure that a package can be installed.

I know that Nix packages declare all of their dependencies explicitly. But can Nix provide a guarantee, or at least a high level of certainty, that a package installation will succeed before it starts? If so, how does it do this? If not, why not, and is there any way to get a similar level of certainty about package installations?

Is there a command to check compatibility of a package before actually running the installation, like a formally verified operating system?

1 Answer 1

2

There are many things maintainers of a package repository can do to ensure that packages served to the public are always installable. The obvious one is the ultimate smoke test: actually install and run executables included in the package on supported hardware (or a VM emulating such hardware). I don't know anything about the relevant system for nixpkgs, but the name which keeps coming up is Hydra.

Beyond running the package, maintainers can run upstream package tests, verify that core functionality of libraries is working when used with other packages, smoke test things like run time or package size, and any other heuristics for a package "working". Formally verifying a modern package repository is probably decades away, because the vast majority of software is not formally verified in any way.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.