Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix paths when using CROSS_CONTAINER_IN_CONTAINER #1483

Merged

Conversation

thirteenowls
Copy link
Contributor

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.

@thirteenowls thirteenowls requested a review from a team as a code owner May 5, 2024 04:11
@Emilgardis
Copy link
Member

/ci try -t cross

This comment has been minimized.

This comment has been minimized.

@thirteenowls thirteenowls force-pushed the fix-container-in-container-paths branch from 30c2218 to c6e3316 Compare May 5, 2024 08:32
@thirteenowls
Copy link
Contributor Author

I forgot about the changelog entry, sorry!

@Emilgardis
Copy link
Member

/ci try -t cross

This comment has been minimized.

This comment has been minimized.

@thirteenowls
Copy link
Contributor Author

thirteenowls commented May 5, 2024

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
Copy link
Member

/ci try -t cross

This comment has been minimized.

This comment has been minimized.

@Emilgardis
Copy link
Member

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

@thirteenowls thirteenowls force-pushed the fix-container-in-container-paths branch from c6e3316 to 109737f Compare May 6, 2024 06:49
@Emilgardis
Copy link
Member

/ci try -t cross

This comment has been minimized.

Copy link

github-actions bot commented May 6, 2024

Try run for comment

Successful Jobs

Copy link
Member

@Emilgardis Emilgardis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Emilgardis Emilgardis added this pull request to the merge queue May 6, 2024
github-merge-queue bot pushed a commit that referenced this pull request May 6, 2024
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.
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 6, 2024
@Emilgardis Emilgardis added the no-ci-targets PRs that do not affect any cross-compilation targets. label May 6, 2024
@Emilgardis
Copy link
Member

failure is unrelated

@Emilgardis Emilgardis added this pull request to the merge queue May 6, 2024
Merged via the queue into cross-rs:main with commit 8b27866 May 6, 2024
22 checks passed
@thirteenowls thirteenowls deleted the fix-container-in-container-paths branch May 7, 2024 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-ci-targets PRs that do not affect any cross-compilation targets.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants