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

Build UStar archives by default #2327

Merged
merged 1 commit into from
Jan 29, 2016
Merged

Conversation

alexcrichton
Copy link
Member

The tar::Builder type by default will build GNU archives, but
unfortunately we force it here to use UStar archives instead. The
UStar format has more limitations on the length of path name that it
can encode, so it's not quite as nice to use.

Older cargos, however, had a bug where GNU archives were interpreted
as UStar archives. This bug means that if we publish a GNU archive
which has fully filled out metadata it'll be corrupt when unpacked by
older cargos.

Hopefully in the future after enough cargos have been running around
with the bugfixed tar-rs library we'll be able to switch this over to
GNU archives, but for now we'll just say that you can't encode paths
in archives that are too long.

Closes #2326

The tar::Builder type by default will build GNU archives, but
unfortunately we force it here to use UStar archives instead. The
UStar format has more limitations on the length of path name that it
can encode, so it's not quite as nice to use.

Older cargos, however, had a bug where GNU archives were interpreted
as UStar archives. This bug means that if we publish a GNU archive
which has fully filled out metadata it'll be corrupt when unpacked by
older cargos.

Hopefully in the future after enough cargos have been running around
with the bugfixed tar-rs library we'll be able to switch this over to
GNU archives, but for now we'll just say that you can't encode paths
in archives that are *too* long.

Closes rust-lang#2326
@rust-highfive
Copy link

r? @wycats

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton
Copy link
Member Author

gonna go ahead and merge so we can get this into the nightlies.

This is a regression in Cargo, but it's purely on the nightly channel of Rust (e.g. stable or beta channel Cargo versions are not affected). Along those lines, I don't think there's much we need to do here other than recommend authors republish crates with older Cargo installations or newer Cargo builds once this is merged.

@bors: r+ 5c0c213

@bors
Copy link
Contributor

bors commented Jan 29, 2016

⌛ Testing commit 5c0c213 with merge 2d065f0...

bors added a commit that referenced this pull request Jan 29, 2016
The tar::Builder type by default will build GNU archives, but
unfortunately we force it here to use UStar archives instead. The
UStar format has more limitations on the length of path name that it
can encode, so it's not quite as nice to use.

Older cargos, however, had a bug where GNU archives were interpreted
as UStar archives. This bug means that if we publish a GNU archive
which has fully filled out metadata it'll be corrupt when unpacked by
older cargos.

Hopefully in the future after enough cargos have been running around
with the bugfixed tar-rs library we'll be able to switch this over to
GNU archives, but for now we'll just say that you can't encode paths
in archives that are *too* long.

Closes #2326
@alexcrichton
Copy link
Member Author

cc @brson

@bors
Copy link
Contributor

bors commented Jan 29, 2016

@bors bors merged commit 5c0c213 into rust-lang:master Jan 29, 2016
@brson
Copy link
Contributor

brson commented Jan 29, 2016

Awesome fast fix. Scary bug.

@brson
Copy link
Contributor

brson commented Jan 29, 2016

@alexcrichton Is this bug in the 1.7 beta's cargo?

@alexcrichton alexcrichton deleted the ustar-archives branch January 29, 2016 07:06
@alexcrichton
Copy link
Member Author

This bug was introduced in dd34296 when the tar-rs library was upgraded from 0.3.2 to 0.4.0 where 0.4.0 created GNU archives by default. That commit was not in 1.7 beta's cargo, so yay!

@sourcefrog
Copy link
Contributor

Hopefully in the future after enough cargos have been running around with the bugfixed tar-rs library we'll be able to switch this over to GNU archives

Do you think 4.5 years is long enough, or do you have a time frame in mind? I just hit the length limit.

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.

Some recently built crates fail to unpack
6 participants