Skip to content

Restrict supported tarball formats to actual Tarballs#10918

Merged
edolstra merged 1 commit intoNixOS:masterfrom
andir:restrict-tarfile-formats
Jun 17, 2024
Merged

Restrict supported tarball formats to actual Tarballs#10918
edolstra merged 1 commit intoNixOS:masterfrom
andir:restrict-tarfile-formats

Conversation

@andir
Copy link
Member

@andir andir commented Jun 15, 2024

Motivation

The documentation is clear about the supported formats (with at least builtins.fetchTarball). The way the code was written previously it supported all the formats that libarchive supported. That is a surprisingly large amount of formats that are likely not on the radar of the Nix developers and users. Before people end up relying on this (or if they do) it is better to break it now before it becomes a widespread "feature".

Zip file support has been retained as (at least to my knowledge)
historically that has been used to fetch nixpkgs in some shell
expressions many years back.

Fixes #10917

Context

See #10917

Priorities and Process

Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

@andir andir requested a review from edolstra as a code owner June 15, 2024 12:09
The documentation is clear about the supported formats (with at least
`builtins.fetchTarball`). The way the code was written previously it
supported all the formats that libarchive supported. That is a
surprisingly large amount of formats that are likely not on the radar
of the Nix developers and users. Before people end up relying on
this (or if they do) it is better to break it now before it becomes a
widespread "feature".

Zip file support has been retained as (at least to my knowledge)
historically that has been used to fetch nixpkgs in some shell
expressions *many* years back.

Fixes NixOS#10917
@andir andir force-pushed the restrict-tarfile-formats branch from e20317f to 5a9e1c0 Compare June 15, 2024 12:29
Copy link
Member

@roberth roberth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Niche formats are a risk for reproducibility; for instance a bugfix or a "new" feature like executable bit support have potential to change source hashes, so it should definitely not be all.
We should only want low risk mature formats.
Any additions other than zip and tar should come with a lengthy piece of research proving those properties.
👍 for me and I hope we don't need any other formats.

@edolstra edolstra merged commit 48d38b3 into NixOS:master Jun 17, 2024
@andir andir deleted the restrict-tarfile-formats branch June 18, 2024 20:19
@lf-
Copy link
Member

lf- commented Jun 18, 2024

I think this is likely to cause regressions no matter how you cut it. The thing we should actually do here is to figure out how to ensure all the archive formats don't change behaviour over versions.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fetchTarball accepts ISO images (and likely many unexpected archive formats)

4 participants