cargo: Failed to mmap
I can’t install anything with cargo.
$ cargo install --verbose rustfmt
Updating registry `https://github.com/rust-lang/crates.io-index`
error: failed to fetch `https://github.com/rust-lang/crates.io-index`
Caused by:
[2/-1] Failed to mmap. Could not write data: Invalid argument
or by putting dependency in Cargo.toml
$ cat Cargo.toml
[package]
name = "test"
version = "0.1.0"
authors = ["test"]
[dependencies]
rustfmt = "0.5"
$ cargo build --verbose
Updating registry `https://github.com/rust-lang/crates.io-index`
error: Unable to update registry https://github.com/rust-lang/crates.io-index
Caused by:
failed to fetch `https://github.com/rust-lang/crates.io-index`
Caused by:
[2/-1] Failed to mmap. Could not write data: Invalid argument
$ rustc --version
rustc 1.9.0 (e4e8b6668 2016-05-18)
$ cargo --version
cargo 0.10.0-nightly (10ddd7d 2016-04-08)
I am running up-to-date Ubuntu 16.04 LTS.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 35 (11 by maintainers)
Links to this issue
Commits related to this issue
- fix wsl build https://github.com/rust-lang/cargo/issues/2808 — committed to jjyr/capsule by jjyr 4 years ago
- Drop support for arm/v7 on Alpine Some strange issue make so that this arch fails to build on Alpine. To not hinder the 3.0.0 release we drop this arch, and hopefully we can reintroduce it in the fut... — committed to JonasAlfredsson/docker-nginx-certbot by JonasAlfredsson 3 years ago
- Add SBOM and use source tarball instead of git See: https://github.com/rust-lang/cargo/issues/2808#issuecomment-229287669 — committed to sudo-bot/docker-rustpython by williamdes a year ago
- Stop using git to build the __doc__ dependency Ref: https://github.com/rust-lang/cargo/issues/2808 Reverts: 31e1e7e4ed671da54c8b321d5f238b0a5dc83607 — committed to sudo-bot/docker-rustpython by williamdes a year ago
- from https://github.com/rust-lang/cargo/issues/2808 — committed to robermar23/mastodon-bot by robermar23 a year ago
I think I have hit the same issue on OSX while wanting to be clever and reuse cargo registry between builds on a docker:
Just have met the same bug in WSL ubuntu-20.
A hint for who has the same issue:
Using local docker volume to map
.cargowon’t trigger this.The
.cargowill be cached between different containers as expected.Hi @williamdes thank you. Yes this works ))
You should try the workaround I used on my docker image for armv6/armv7 See: https://github.com/rust-lang/cargo/issues/6513#issuecomment-1440029221
Please let us know if works for you
@jml Sorry, no. My project is very small so this is minor for me.