cross-rs / cross

“Zero setup” cross compilation and “cross testing” of Rust crates
Apache License 2.0
6.21k stars 354 forks source link

Fix paths when using `CROSS_CONTAINER_IN_CONTAINER` #1483

Closed thirteenowls closed 2 months ago

thirteenowls commented 2 months ago

Currently, MountFinder is used for almost all paths, rather than only for the host path in bind/volume mounts.

Because of this, docker build invocations use the wrong working directory (/var/lib/docker/.../workdir-path instead of /workdir-path), causing failures for builds that use pre-build with a relative file path, and docker run invocations use incorrect -v arguments (e.g. /var/lib/docker/.../toolchain-dir:/var/lib/docker/.../toolchain-dir instead of /var/lib/docker/.../toolchain-dir:/toolchain-dir).

This PR fixes those issues by only using find_path and find_mount_path when necessary.

Emilgardis commented 2 months ago

/ci try -t cross

github-actions[bot] commented 2 months ago

Starting try run. Link to action

github-actions[bot] commented 2 months ago

Try run for comment

thirteenowls commented 2 months ago

I forgot about the changelog entry, sorry!

Emilgardis commented 2 months ago

/ci try -t cross

github-actions[bot] commented 2 months ago

Starting try run. Link to action

github-actions[bot] commented 2 months ago

Try run for comment

thirteenowls commented 2 months ago

The Windows CI failure seems to be caused by a recent commit to dtolnay/rust-toolchain, which sets CARGO_HOME: https://github.com/cross-rs/cross/actions/runs/8956947724/job/24605204754?pr=1483#step:4:21

Edit: Fixed in #1484.

Emilgardis commented 2 months ago

/ci try -t cross

github-actions[bot] commented 2 months ago

Starting try run. Link to action

github-actions[bot] commented 2 months ago

Try run for comment

Emilgardis commented 2 months ago

oh yeah, it doesn't rebase to master, should fix that :3

Emilgardis commented 2 months ago

/ci try -t cross

github-actions[bot] commented 2 months ago

Starting try run. Link to action

github-actions[bot] commented 2 months ago

Try run for comment

Successful Jobs

Emilgardis commented 2 months ago

failure is unrelated