You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When executing the command DOCKER_HOST=... CROSS_REMOTE=1 ~/.cargo/bin/cross --verbose build --target arm-unknown-linux-gnueabi, I encountered the error sh: 1: cargo: not found.
With verbose output enabled, I discovered that the following command was executed:
/home/gitlab-workspaces/.nix-profile/bin/docker exec cross-stable-x86_64-unknown-linux-gnu-ae81e-79e9716c9-arm-unknown-linux-gnueabi-plcc-blockchain-tools-c1946 sh -c 'mkdir -p '\''/cross/cargo'\'''
/home/gitlab-workspaces/.nix-profile/bin/docker cp -a /home/gitlab-workspaces/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin cross-stable-x86_64-unknown-linux-gnu-ae81e-79e9716c9-arm-unknown-linux-gnueabi-plcc-blockchain-tools-c1946:/cross/rust
The second command copies the /home/gitlab-workspaces/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin directory as /cross/rust instead of copying the folder to /cross/rust/ if the /cross/rust directory does not exist. (Only 'cross/cargo' was created in the previous command)
@Emilgardis You're right. It's a Nix related issue. the cargo was patched by Nix, so the error message isn't about the cargo itself, but its elf interpreter cannot be found in the container. It can be worked around by setting the interpreter back to /lib64/ld-linux-x86-64.so.2 before being copied from Nix environment.
Emilgardis
changed the title
Remote docker throws "sh: 1: cargo: not found" error
Remote docker throws "sh: 1: cargo: not found" error if cargo comes from nix distribution
Dec 12, 2023
Checklist
Describe your issue
When executing the command DOCKER_HOST=... CROSS_REMOTE=1 ~/.cargo/bin/cross --verbose build --target arm-unknown-linux-gnueabi, I encountered the error sh: 1: cargo: not found.
With verbose output enabled, I discovered that the following command was executed:
The second command copies the /home/gitlab-workspaces/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin directory as /cross/rust instead of copying the folder to /cross/rust/ if the /cross/rust directory does not exist. (Only 'cross/cargo' was created in the previous command)
This behavior will cause the subsequent command:
which attempt to use the cargo executable from the /rust/bin folder to fail.
What target(s) are you cross-compiling for?
No response
Which operating system is the host (e.g computer cross is on) running?
What architecture is the host?
What container engine is cross using?
cross version
cross 0.2.5
Example
No response
Additional information / notes
No response
The text was updated successfully, but these errors were encountered: