Skip to content

Using rust from distro repo makes cross mount wierd directory #1198

Open
@blinxen

Description

Checklist

Describe your issue

I have installed rust from the official fedora repository but I still want to sometimes use cross for testing purposes. So for this I installed rustup and made my default toolchain to be the rust version that I installed via the package manager. My ~/.rustup/toolchains directory looks like this:

drwxr-xr-x. 1 xxx xxx 42 Jan 30 22:18 stable-x86_64-unknown-linux-gnu
lrwxrwxrwx. 1 xxx xxx  4 Jan 30 22:18 system -> /usr

When I try to run the following command (added -v to see what cross is trying to do):

CROSS_CONTAINER_ENGINE=podman cross +stable test --target i686-unknown-linux-gnu -v

Then I get an error message that looks like this:

+ cargo +stable metadata --format-version 1 --filter-platform i686-unknown-linux-gnu
+ rustc --print sysroot
+ rustup toolchain list
+ rustup --verbose toolchain add stable --profile minimal
verbose: read metadata version: '12'
verbose: updating existing install for 'stable-x86_64-unknown-linux-gnu'
verbose: toolchain directory: '/home/xxx/.rustup/toolchains/stable-x86_64-unknown-linux-gnu'
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
verbose: creating temp file: /home/xxx/.rustup/tmp/mce693vqz1yhvje6_file
verbose: downloading file from: 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256'
verbose: downloading with reqwest
verbose: deleted temp file: /home/xxx/.rustup/tmp/mce693vqz1yhvje6_file
verbose: toolchain is already up to date

  stable-x86_64-unknown-linux-gnu unchanged - rustc 1.67.0 (fc594f156 2023-01-24)

info: checking for self-updates
+ rustup target list --toolchain stable
+ rustup component list --toolchain stable
+ /usr/bin/podman
+ /usr/bin/podman run --userns host -e 'PKG_CONFIG_ALLOW_CROSS=1' -e 'XARGO_HOME=/xargo' -e 'CARGO_HOME=/cargo' -e 'CARGO_TARGET_DIR=/target' -e 'CROSS_RUNNER=' -e TERM -e 'USER=xxx' --rm -v /home/xxx/.xargo:/xargo:Z -v /home/xxx/.cargo:/cargo:Z -v /cargo/bin -v /home/xxx/xxx/fallible_collections:/project:Z -v /stable:/rust:Z,ro -v /home/xxx/xxx/fallible_collections/target:/target:Z -w /project -i -t ghcr.io/cross-rs/i686-unknown-linux-gnu:0.2.4 sh -c 'PATH=$PATH:/rust/bin cargo test --target i686-unknown-linux-gnu -v'
Error: statfs /stable: no such file or directory
+ rustup component list --toolchain stable

It seems wierd to me that cross is trying to mount a /stable directory. Replacing the +stable with +PATH_TO_stable-x86_64-unknown-linux-gnu seems to fix my problem. Is this a bug or is this intended?

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

i686-unknown-linux-gnu

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

0.2.4

Example

No response

Additional information / notes

No response

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions