Skip to content

cargo --frozen requires the cargo home to be writable #7147

Closed
@glandium

Description

@glandium

Before whatever change #6940 was undoing, a non-existing CARGO_HOME worked with --frozen. But despite #6940, upgrading cargo to 1.36/0.37 on Debian broke Firefox builds on Debian builders, where they now fail with:

ERROR: Couldn't execute `cargo metadata` with manifest "/<<PKGBUILDDIR>>/toolkit/library/rust/Cargo.toml": Metadata(Output { status: ExitStatus(ExitStatus(25856)), stdout: "", stderr: "error: failed to acquire package cache lock\n\nCaused by:\n  failed to open: /sbuild-nonexistent/.cargo/.package-cache\n\nCaused by:\n  Permission denied (os error 13)\n" })
ERROR: Couldn't generate bindings for /<<PKGBUILDDIR>>/toolkit/library/rust.

/sbuild-nonexistent comes from HOME being set to that value, and not existing, which ensures building packages doesn't rely on doing anything with $HOME.

A minimal reproducer:

$ cargo new foo
     Created binary (application) `foo` package
$ cd foo
$ CARGO_HOME=/forbidden cargo build --frozen
error: failed to acquire package cache lock

Caused by:
  failed to open: /forbidden/.package-cache

Caused by:
  Permission denied (os error 13)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions