NewsCrawler.org

A Nixpkgs change broke 500–1000 packages; the author urges crates to use system-deps

The author, a NixOS/Nixpkgs maintainer who also writes Rust, describes a merged pull request that broke roughly 500 to 1000 packages in Nixpkgs and, through their dependencies, most of Nixpkgs. The big packages were fixed in the testing branch before the change reached the rolling release, but the tail of less-used packages is long.

The reason given is security. Rust crates often rely on vendoring[1] to bundle C libraries, build them and perform static linking[2], which makes it hard to tell whether a library is in the final binary and hard to update or track it. Nixpkgs builds Rust packages with locked dependencies, so an old vendored library such as aws-lc or openssl can stay in use for years after a CVE[3] in it is fixed upstream.

The author recommends the system-deps[4] crate, which provides a standard API: distributions can force linking to the system library, and crate authors can provide a fallback that builds from source. The author also advises constraining versions properly and checking whether a native library breaks in minor versions. An example crate was switched to system-deps and uses the system library when the probe succeeds, falling back to building only on an error, because system-deps requires the end user to explicitly allow that fallback.

Repository Nixpkgs github.com

Nix Packages collection and NixOS: a large repository of package definitions used to build and install software on Nix and NixOS.

Stars: 26,921Forks: 20,815License: MITUpdated:

Read the original blog.rsmyth.netDiscussion

Discussion

Commenters are divided. One asks whether crate authors would have to rewrite their dependency handling and get pull requests merged to adopt system-deps. Another argues that a vulnerable dependency does not automatically make the project that uses it vulnerable, and that the approach looks like using security as a reason for changes.

Sources

  • blog.rsmyth.net

    Breaking 1000 Rust crates in Nixpkgs for security (and what you can do)

    18 comments

Published: First seen: Читать по-русски

Open as a page