Skip to content

Remove [root] section from Cargo.lock file #4563

Closed
@matklad

Description

@matklad

Cargo.lock includes [root] section which is no longer used for anything, because it became obsolete when Cargo workspaces were implemented.

About a year ago, support for rootless lockfiles was implemented: 5e644df.

However, by default Cargo still adds an arbitrary root to be compatible with older Cargos. Given that we have a year's worth of new Cargos, I think we can safely switch to rootless lockfiles.

This code should be removed:

let use_root_key = if let Ok(ref orig) = orig {
!orig.starts_with("[[package]]")
} else {
true
};

However, we should make sure that Cargo is still able to read a lockfile with a root section (there's a test for this).

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-easyExperience: Easy

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions