Skip to content

binaries are not copied back to host with CROSS_REMOTE #1103

Closed
@citizen-stig

Description

@citizen-stig

Checklist

  • I've looked through the issues and pull requests for similar reports

Describe your issue

After revision 3a897ba with using CROSS_REMOTE produced binaries are not copied to host.

I believe that PR #1072 might cause this issue

What target(s) are you cross-compiling for?

No response

Which operating system is the host (e.g computer cross is on) running?

  • macOS
    Windows
    Linux / BSD
    other OS (specify in description)

What architecture is the host?

  • x86_64 / AMD64
    arm32
    arm64 (including Mac M1)

What container engine is cross using?

  • docker
    podman
    other container engine (specify in description)

cross version

cross 0.2.4 (a8082de 2022-10-26)

Example

No response

Additional information / notes

No response

Activity

self-assigned this
on Oct 31, 2022
Alexhuszagh

Alexhuszagh commented on Oct 31, 2022

@Alexhuszagh
Contributor

We should probably add a CI check to ensure the binaries are copied back to the host in ci/test-remote.sh as well, and not copied when the relevant flags are provided.

Alexhuszagh

Alexhuszagh commented on Nov 2, 2022

@Alexhuszagh
Contributor

It's checking the wrong directory when attempting to copy back:

/usr/bin/docker exec cross-stable-x86_64-unknown-linux-gnu-16b8c-a8314ef7d-aarch64-unknown-linux-gnu-9076c-1667357458637 bash -c '[[ -d '\''/cross/target'\'' ]]'

This is because the target directory here isn't being mounted at /cross/target. This hopefully should be an easy fix.

And this is because we're using a relative target directory in the build:

/usr/bin/docker exec --user 1000:1000 -e 'PKG_CONFIG_ALLOW_CROSS=1' -e 'XARGO_HOME=/home/ahuszagh/.xargo' -e 'CARGO_HOME=/home/ahuszagh/.cargo' -e 'CARGO_TARGET_DIR=/target' -e 'CROSS_RUNNER=' -e CROSS_REMOTE -e TERM -e 'USER=ahuszagh' -e 'CROSS_RUSTC_MAJOR_VERSION=1' -e 'CROSS_RUSTC_MINOR_VERSION=62' -e 'CROSS_RUSTC_PATCH_VERSION=0' -w /home/ahuszagh/Desktop/cross/rust-c-hello-world cross-stable-x86_64-unknown-linux-gnu-16b8c-a8314ef7d-aarch64-unknown-linux-gnu-9076c-1667357458637 sh -c 'PATH="$PATH":"/home/ahuszagh/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin" cargo build --target aarch64-unknown-linux-gnu --verbose --target-dir target

So, we need the --target-dir probably be an absolute path if not provided.

added this to the v0.3.0 milestone on Nov 24, 2022
hulucc

hulucc commented on Feb 2, 2023

@hulucc
Contributor

It's checking the wrong directory when attempting to copy back:

/usr/bin/docker exec cross-stable-x86_64-unknown-linux-gnu-16b8c-a8314ef7d-aarch64-unknown-linux-gnu-9076c-1667357458637 bash -c '[[ -d '\''/cross/target'\'' ]]'

This is because the target directory here isn't being mounted at /cross/target. This hopefully should be an easy fix.

And this is because we're using a relative target directory in the build:

/usr/bin/docker exec --user 1000:1000 -e 'PKG_CONFIG_ALLOW_CROSS=1' -e 'XARGO_HOME=/home/ahuszagh/.xargo' -e 'CARGO_HOME=/home/ahuszagh/.cargo' -e 'CARGO_TARGET_DIR=/target' -e 'CROSS_RUNNER=' -e CROSS_REMOTE -e TERM -e 'USER=ahuszagh' -e 'CROSS_RUSTC_MAJOR_VERSION=1' -e 'CROSS_RUSTC_MINOR_VERSION=62' -e 'CROSS_RUSTC_PATCH_VERSION=0' -w /home/ahuszagh/Desktop/cross/rust-c-hello-world cross-stable-x86_64-unknown-linux-gnu-16b8c-a8314ef7d-aarch64-unknown-linux-gnu-9076c-1667357458637 sh -c 'PATH="$PATH":"/home/ahuszagh/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin" cargo build --target aarch64-unknown-linux-gnu --verbose --target-dir target

So, we need the --target-dir probably be an absolute path if not provided.

It works when replace target_dir with format!("{}/{}", package_dirs.mount_root(), target_dir) when copying back.

Emilgardis

Emilgardis commented on Feb 2, 2023

@Emilgardis
Member

Do you want to create a pr to solve this issue @hulucc ? That seems like the way to solve it.

added a commit that references this issue on Feb 10, 2023
404ee1f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

    Participants

    @Emilgardis@citizen-stig@hulucc@Alexhuszagh

    Issue actions

      binaries are not copied back to host with `CROSS_REMOTE` · Issue #1103 · cross-rs/cross