Skip to content

Next tar-rs update creates sparse entries by default #14594

Closed
@xzfc

Description

@xzfc

Recently, the tar crate got support for creating archives with sparse entries (alexcrichton/tar-rs#375). It is going to be enabled by default in the next release.

For Cargo (which depends on this crate), keeping the default would mean that some very old versions of Cargo would not be able to read some archives created by the latest Cargo. Specifically, the ability to read sparse entries was added in tar 0.4.6 (released 2016-06-09). The corresponding tar-rs bump for Cargo was #2973, which is included in Cargo 0.13 which is included in rust 1.12.

The sparseness check does not affect Rust source files (as text files generally do not contain large chunks of null bytes), but it may affect crates containing binary files. For example, protobuf-build and metal crates contain binaries that could possibly be sparse. The command rg -ca '\x00{4096}' ~/.cargo/registry/ might reveal other similar binaries.

I'm creating this issue at the request of @alexcrichton to let the Cargo team decide whether to

  • keep the new default as-is, or
  • add a few ar.sparse(false) calls explicitly everywhere tar::Builder is used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    S-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or review

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions