Skip to content

Cargo attempts to re-extract const-arrayvec 0.2.1Β #8816

@Nemo157

Description

@Nemo157

Problem
When building a crate that depends on const-arrayvec cargo attempts to write to the ~/.cargo/registry folder even after cargo fetch has been run.

Steps

> cargo new foo
     Created binary (application) `foo` package
> cd foo
> cargo add const-arrayvec
    Updating 'https://github.com/rust-lang/crates.io-index' index
      Adding const-arrayvec v0.2.1 to dependencies
> cargo fetch
    Updating crates.io index
> mkdir target
> bwrap --ro-bind / / --tmpfs /tmp --dev /dev --tmpfs /run --ro-bind $(pwd) $(pwd) --bind $(pwd)/target $(pwd)/target --unshare-net cargo check --locked
error: failed to download `const-arrayvec v0.2.1`

Caused by:
  unable to get packages from source

Caused by:
  failed to unpack package `const-arrayvec v0.2.1`

Caused by:
  failed to open `/home/nemo157/.cargo/registry/src/github.com-1ecc6299db9ec823/const-arrayvec-0.2.1/.cargo-ok`

Caused by:
  Read-only file system (os error 30)

Notes

Seems to reproduce on a variety of toolchains back to 1.36 at least, so not something new.

> cargo -vV
cargo 1.49.0-nightly (79b397d72 2020-10-15)
release: 1.49.0
commit-hash: 79b397d72c557eb6444a2ba0dc00a211a226a35a
commit-date: 2020-10-15

This was noticed on docs.rs, because rustwide uses a very similar sandboxing scheme.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-cachingArea: caching of dependencies, repositories, and build artifactsC-bugCategory: bugE-easyExperience: Easy

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions