cross-rs/cross

failed to create directory /target/debug

Closed this issue · 2 comments

Hello.
I have a problem with cross:

mhanusek@et-0989:~/work/code/ekm3/ekm-gateway$ cross build --target=arm-unknown-linux-gnueabihf --features bbb -vvv
+ cargo metadata --format-version 1 --filter-platform arm-unknown-linux-gnueabihf --features bbb
[cross] warning: found unused key(s) in Cross configuration at /home/mhanusek/work/code/ekm3/ekm-gateway/Cross.toml:
 > target.arm-unknown-linux-gnueabihf.volumes
+ rustc --print sysroot
+ /usr/local/bin/docker
+ /usr/local/bin/docker version -f '{{ .Server.Os }},,,{{ .Server.Arch }}'
+ /usr/local/bin/docker info -f {{.SecurityOptions}}
+ rustup toolchain list
+ rustup target list --toolchain 1.78.0-x86_64-unknown-linux-gnu
+ rustup component list --toolchain 1.78.0-x86_64-unknown-linux-gnu
+ /usr/local/bin/docker run --userns host -e 'XARGO_HOME=/home/mhanusek/.xargo' -e 'CARGO_HOME=/home/mhanusek/.cargo' -e 'CROSS_RUST_SYSROOT=/home/mhanusek/.rustup/toolchains/1.78.0-x86_64-unknown-linux-gnu' -e 'CARGO_TARGET_DIR=/target' -e 'CROSS_RUNNER=' -e TERM -e 'USER=mhanusek' -e 'CROSS_RUSTC_MAJOR_VERSION=1' -e 'CROSS_RUSTC_MINOR_VERSION=78' -e 'CROSS_RUSTC_PATCH_VERSION=0' --name cross-1.78.0-x86_64-unknown-linux-gnu-1d900-9b00956e5-arm-unknown-linux-gnueabihf-2eb32-1717149528810 --rm --user 1000:1000 -v /home/mhanusek/.xargo:/home/mhanusek/.xargo:z -v /home/mhanusek/.cargo:/home/mhanusek/.cargo:z -v /home/mhanusek/.cargo/bin -v /home/mhanusek/work/code/ekm3/ekm-gateway:/home/mhanusek/work/code/ekm3/ekm-gateway:z -v /home/mhanusek/.rustup/toolchains/1.78.0-x86_64-unknown-linux-gnu:/home/mhanusek/.rustup/toolchains/1.78.0-x86_64-unknown-linux-gnu:z,ro -v /home/mhanusek/work/code/ekm3/ekm-gateway/target:/target:z -w /home/mhanusek/work/code/ekm3/ekm-gateway -t ghcr.io/cross-rs/arm-unknown-linux-gnueabihf:main sh -c 'PATH="$PATH":"/home/mhanusek/.rustup/toolchains/1.78.0-x86_64-unknown-linux-gnu/bin" cargo build --target=arm-unknown-linux-gnueabihf --features bbb -vvv'
warning: both `/home/mhanusek/.cargo/config` and `/home/mhanusek/.cargo/config.toml` exist. Using `/home/mhanusek/.cargo/config`
warning: both `/home/mhanusek/.cargo/config` and `/home/mhanusek/.cargo/config.toml` exist. Using `/home/mhanusek/.cargo/config`
error: failed to create directory `/target/debug`

Caused by:
  Permission denied (os error 13)
+ rustup component list --toolchain 1.78.0-x86_64-unknown-linux-gnu
mhanusek@et-0989:~/work/code/ekm3/ekm-gateway$ cross --version
]cross 0.2.5 (19be834 2024-05-17)
[cross] warning: found unused key(s) in Cross configuration at /home/mhanusek/work/code/ekm3/ekm-gateway/Cross.toml:
 > target.arm-unknown-linux-gnueabihf.volumes
[cross] note: Falling back to `cargo` on the host.
warning: both `/home/mhanusek/.cargo/config` and `/home/mhanusek/.cargo/config.toml` exist. Using `/home/mhanusek/.cargo/config`
warning: both `/home/mhanusek/.cargo/config` and `/home/mhanusek/.cargo/config.toml` exist. Using `/home/mhanusek/.cargo/config`
cargo 1.78.0 (54d8815d0 2024-03-26)

Please help!

can you try cross build --target=arm-unknown-linux-gnueabihf --features bbb -vvv --release and see if it progresses?

Can you also show me output of docker info

I solved it.
The reason was docker-desktop. When I disabled docker-desktop, it worked.