This repository was archived by the owner on Jan 18, 2025. It is now read-only.
This repository was archived by the owner on Jan 18, 2025. It is now read-only.
Compilation failed while installing cargo-watch on Docker #210
Open
Description
Hello, I'm trying to install using cargo install cargo-watch
in a fresh Docker image linux/amd64 based. No success due to compilation error on the termcolor
crate.
Environment
- Docker 20.10
- Macbook Pro M1, macOS Monterey 12.1
- Docker Hub image official image,
rust:latest
linux:amd64 - rustc 1.62.1 (e092d0b6b 2022-07-16)
- cargo 1.62.1 (a748cf5a3 2022-06-08)
Steps
$ cargo install cargo-watch
Updating crates.io index
Installing cargo-watch v8.1.2
...
Output
Compiling termcolor v1.1.3
/usr/local/rustup/toolchains/1.62.1-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-1bde28880ea8bde8.so(+0x4e54e3)[0x40021864e3]
...
/usr/local/rustup/toolchains/1.62.1-x86_64-unknown-linux-gnu/bin/../lib/libstd-69edc9ac8de4d39c.so(rust_metadata_std_8996aeeb2a45fe64+0xab3c3)[0x4005ccb3c3]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x8ea7)[0x4005fb2ea7]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x3f)[0x40060d4def]
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
error: could not compile `strsim`
Caused by:
process didn't exit successfully: `rustc --crate-name strsim /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/strsim-0.8.0/src/lib.rs --error-format=json --json=d
iagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C panic=abort -C linker-plugin-lto -C codegen-units=1 -C met
adata=7c4474c11a45725d -C extra-filename=-7c4474c11a45725d --out-dir /tmp/cargo-installJwbEQY/release/deps -L dependency=/tmp/cargo-installJwbEQY/release/deps --cap-lints al
low` (signal: 11, SIGSEGV: invalid memory reference)
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
error: could not compile `termcolor`
Caused by:
process didn't exit successfully: `rustc --crate-name termcolor --edition=2018 /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/termcolor-1.1.3/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C panic=abort -C linker-plugin-lto -C codegen-units=1 -C metadata=9ea925993c53af48 -C extra-filename=-9ea925993c53af48 --out-dir /tmp/cargo-installJwbEQY/release/deps -L dependency=/tmp/cargo-installJwbEQY/release/deps --cap-lints allow` (signal: 11, SIGSEGV: invalid memory reference)
Conclusion
It seems like it's getting a segmentation fault while compiling strsim
on emulated environments?
Anyway, I appreciate any help in case anyone already faced the same issue. Thanks in advance.