-
Notifications
You must be signed in to change notification settings - Fork 377
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
Immediately Terminates with "'rustc --print target-list' failed" #526
Comments
Also getting this error. Not really sure where to go from here. |
Having the same issue... |
The same thing started to happen with Rust 1.54.0 and target |
Has this been resolved? I'm getting this error as well:
|
@dbischof90 can you please add |
Rowing back - I think I solved at least my case. I had to add my user to the EDIT: my
and I run on Arch. But that seems to be unrelated here. With
so it needs my username as input which might not be accessible if called through |
This command should be running on the host, and therefore shouldn't be affected by whether or not Docker is invoked or not. Line 279 in d90b016
This failing suggests something odd is happening with your system. Can you report the output of: # we don't care about stdout, just the error output and exit code
$ rustc --print target-list >/dev/null
$ echo $? This should give I've tried this on
I've tried both the 0.2.1 release and cross built from main. This suggests to me it's probably not an issue in cross or the rust version but an issue in the installed rust toolchain. tl;dr |
This no longer reproduces it seems. I've got verbose output information from cross v0.2.2 running with those specific toolchains, on an $ cross +1.54 --version
cross 0.2.2
Warning: using older rustc `1.54.0 (a178d0322 2021-07-26)` for the target. Current active rustc on the host is `rustc 1.61.0 (fe5b13d68 2022-05-18)`.
> Update with `rustup update --force-non-host 1.54-x86_64-unknown-linux-gnu`
Warning: Falling back to `cargo` on the host.
cargo 1.54.0 (5ae8d74b3 2021-06-22)
+ cargo metadata --format-version 1 --filter-platform armv7-unknown-linux-gnueabihf
+ rustc --print sysroot
+ rustup toolchain list
Warning: using older rustc `1.54.0 (a178d0322 2021-07-26)` for the target. Current active rustc on the host is `rustc 1.61.0 (fe5b13d68 2022-05-18)`.
> Update with `rustup update --force-non-host 1.54.0-x86_64-unknown-linux-gnu`
+ rustup target list --toolchain 1.54.0-x86_64-unknown-linux-gnu
+ rustup component list --toolchain 1.54.0-x86_64-unknown-linux-gnu
+ rustup component add rust-src --toolchain 1.54.0-x86_64-unknown-linux-gnu
info: downloading component 'rust-src'
info: installing component 'rust-src'
+ /usr/bin/docker
+ /usr/bin/docker 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 'USER=ahuszagh' --rm --user 1000:1000 -v /home/ahuszagh/.xargo:/xargo:Z -v /home/ahuszagh/.cargo:/cargo:Z -v /cargo/bin -v /home/ahuszagh/Desktop/cross/rust-c-hello-world:/project:Z -v /home/ahuszagh/.rustup/toolchains/1.54.0-x86_64-unknown-linux-gnu:/rust:Z,ro -v /home/ahuszagh/Desktop/cross/rust-c-hello-world/target:/target:Z -w /project -i ghcr.io/cross-rs/armv7-unknown-linux-gnueabihf:main sh -c 'PATH=$PATH:/rust/bin cargo run --target armv7-unknown-linux-gnueabihf -vv'
Fresh cc v1.0.73
Fresh hellopp v0.1.0 (/project)
Finished dev [unoptimized + debuginfo] target(s) in 0.14s
Running `/linux-runner armv7 /target/armv7-unknown-linux-gnueabihf/debug/hellopp`
Hello, world! Nor does it fail on the nightly compiler: $ cross +nightly-2021-02-14 --version
cross 0.2.2
Warning: using older rustc `1.52.0-nightly (8e54a2113 2021-02-13)` for the target. Current active rustc on the host is `rustc 1.61.0 (fe5b13d68 2022-05-18)`.
> Update with `rustup update --force-non-host nightly-2021-02-14-x86_64-unknown-linux-gnu`
Warning: Falling back to `cargo` on the host.
cargo 1.51.0-nightly (ab64d1393 2021-02-10)
$ cross +nightly-2021-02-14 run --target armv7-unknown-linux-gnueabihf -vv
+ cargo metadata --format-version 1 --filter-platform armv7-unknown-linux-gnueabihf
+ rustc --print sysroot
+ rustup toolchain list
Warning: using older rustc `1.52.0-nightly (8e54a2113 2021-02-13)` for the target. Current active rustc on the host is `rustc 1.61.0 (fe5b13d68 2022-05-18)`.
> Update with `rustup update --force-non-host nightly-2021-02-14-x86_64-unknown-linux-gnu`
+ rustup target list --toolchain nightly-2021-02-14-x86_64-unknown-linux-gnu
+ rustup component list --toolchain nightly-2021-02-14-x86_64-unknown-linux-gnu
+ /usr/bin/docker
+ /usr/bin/docker 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 'USER=ahuszagh' --rm --user 1000:1000 -v /home/ahuszagh/.xargo:/xargo:Z -v /home/ahuszagh/.cargo:/cargo:Z -v /cargo/bin -v /home/ahuszagh/Desktop/cross/rust-c-hello-world:/project:Z -v /home/ahuszagh/.rustup/toolchains/nightly-2021-02-14-x86_64-unknown-linux-gnu:/rust:Z,ro -v /home/ahuszagh/Desktop/cross/rust-c-hello-world/target:/target:Z -w /project -i ghcr.io/cross-rs/armv7-unknown-linux-gnueabihf:main sh -c 'PATH=$PATH:/rust/bin cargo run --target armv7-unknown-linux-gnueabihf -vv'
Compiling cc v1.0.73
Running `CARGO=/rust/bin/cargo CARGO_CRATE_NAME=cc CARGO_MANIFEST_DIR=/cargo/registry/src/github.com-1ecc6299db9ec823/cc-1.0.73 CARGO_PKG_AUTHORS='Alex Crichton <[email protected]>' CARGO_PKG_DESCRIPTION='A build-time dependency for Cargo build scripts to assist in invoking the native
C compiler to compile native C code into a static archive to be linked into Rust
code.
' CARGO_PKG_HOMEPAGE='https://github.com/alexcrichton/cc-rs' CARGO_PKG_LICENSE=MIT/Apache-2.0 CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=cc CARGO_PKG_REPOSITORY='https://github.com/alexcrichton/cc-rs' CARGO_PKG_VERSION=1.0.73 CARGO_PKG_VERSION_MAJOR=1 CARGO_PKG_VERSION_MINOR=0 CARGO_PKG_VERSION_PATCH=73 CARGO_PKG_VERSION_PRE='' LD_LIBRARY_PATH='/target/debug/deps:/rust/lib' rustc --crate-name cc --edition=2018 /cargo/registry/src/github.com-1ecc6299db9ec823/cc-1.0.73/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=83d179b7eb1eef0a -C extra-filename=-83d179b7eb1eef0a --out-dir /target/debug/deps -L dependency=/target/debug/deps --cap-lints warn`
Compiling hellopp v0.1.0 (/project)
Running `CARGO=/rust/bin/cargo CARGO_CRATE_NAME=build_script_build CARGO_MANIFEST_DIR=/project CARGO_PKG_AUTHORS='Jorge Aparicio <[email protected]>' CARGO_PKG_DESCRIPTION='' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE='' CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=hellopp CARGO_PKG_REPOSITORY='' CARGO_PKG_VERSION=0.1.0 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=1 CARGO_PKG_VERSION_PATCH=0 CARGO_PKG_VERSION_PRE='' CARGO_PRIMARY_PACKAGE=1 LD_LIBRARY_PATH='/target/debug/deps:/rust/lib' rustc --crate-name build_script_build build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=5f47bddf08f026e8 -C extra-filename=-5f47bddf08f026e8 --out-dir /target/debug/build/hellopp-5f47bddf08f026e8 -C incremental=/target/debug/incremental -L dependency=/target/debug/deps --extern cc=/target/debug/deps/libcc-83d179b7eb1eef0a.rlib`
Running `/target/debug/build/hellopp-5f47bddf08f026e8/build-script-build`
[hellopp 0.1.0] TARGET = Some("armv7-unknown-linux-gnueabihf")
[hellopp 0.1.0] OPT_LEVEL = Some("0")
[hellopp 0.1.0] HOST = Some("x86_64-unknown-linux-gnu")
[hellopp 0.1.0] CC_armv7-unknown-linux-gnueabihf = None
[hellopp 0.1.0] CC_armv7_unknown_linux_gnueabihf = Some("arm-linux-gnueabihf-gcc")
[hellopp 0.1.0] CFLAGS_armv7-unknown-linux-gnueabihf = None
[hellopp 0.1.0] CFLAGS_armv7_unknown_linux_gnueabihf = None
[hellopp 0.1.0] TARGET_CFLAGS = None
[hellopp 0.1.0] CFLAGS = None
[hellopp 0.1.0] CRATE_CC_NO_DEFAULTS = None
[hellopp 0.1.0] DEBUG = Some("true")
[hellopp 0.1.0] CARGO_CFG_TARGET_FEATURE = Some("aclass,dsp,v5te,v6,v6k,v6t2,v7,vfp2")
[hellopp 0.1.0] running: "arm-linux-gnueabihf-gcc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-march=armv7-a" "-mfpu=vfpv3-d16" "-Wall" "-Wextra" "-o" "/target/armv7-unknown-linux-gnueabihf/debug/build/hellopp-716ff43ad176b8b9/out/hello.o" "-c" "hello.c"
[hellopp 0.1.0] exit code: 0
[hellopp 0.1.0] AR_armv7-unknown-linux-gnueabihf = None
[hellopp 0.1.0] AR_armv7_unknown_linux_gnueabihf = None
[hellopp 0.1.0] TARGET_AR = None
[hellopp 0.1.0] AR = None
[hellopp 0.1.0] CROSS_COMPILE = None
[hellopp 0.1.0] running: "arm-linux-gnueabihf-ar" "cq" "/target/armv7-unknown-linux-gnueabihf/debug/build/hellopp-716ff43ad176b8b9/out/libhello.a" "/target/armv7-unknown-linux-gnueabihf/debug/build/hellopp-716ff43ad176b8b9/out/hello.o"
[hellopp 0.1.0] exit code: 0
[hellopp 0.1.0] running: "arm-linux-gnueabihf-ar" "s" "/target/armv7-unknown-linux-gnueabihf/debug/build/hellopp-716ff43ad176b8b9/out/libhello.a"
[hellopp 0.1.0] exit code: 0
[hellopp 0.1.0] cargo:rustc-link-lib=static=hello
[hellopp 0.1.0] cargo:rustc-link-search=native=/target/armv7-unknown-linux-gnueabihf/debug/build/hellopp-716ff43ad176b8b9/out
[hellopp 0.1.0] cargo:rerun-if-changed=build.rs
[hellopp 0.1.0] cargo:rerun-if-changed=hello.c
Running `CARGO=/rust/bin/cargo CARGO_BIN_NAME=hellopp CARGO_CRATE_NAME=hellopp CARGO_MANIFEST_DIR=/project CARGO_PKG_AUTHORS='Jorge Aparicio <[email protected]>' CARGO_PKG_DESCRIPTION='' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE='' CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=hellopp CARGO_PKG_REPOSITORY='' CARGO_PKG_VERSION=0.1.0 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=1 CARGO_PKG_VERSION_PATCH=0 CARGO_PKG_VERSION_PRE='' CARGO_PRIMARY_PACKAGE=1 LD_LIBRARY_PATH='/target/debug/deps:/rust/lib' OUT_DIR=/target/armv7-unknown-linux-gnueabihf/debug/build/hellopp-716ff43ad176b8b9/out rustc --crate-name hellopp src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=5f1ff406c81f9e5d -C extra-filename=-5f1ff406c81f9e5d --out-dir /target/armv7-unknown-linux-gnueabihf/debug/deps --target armv7-unknown-linux-gnueabihf -C linker=arm-linux-gnueabihf-gcc -C incremental=/target/armv7-unknown-linux-gnueabihf/debug/incremental -L dependency=/target/armv7-unknown-linux-gnueabihf/debug/deps -L dependency=/target/debug/deps -L native=/target/armv7-unknown-linux-gnueabihf/debug/build/hellopp-716ff43ad176b8b9/out -l static=hello`
Finished dev [unoptimized + debuginfo] target(s) in 2.58s
Running `/linux-runner armv7 /target/armv7-unknown-linux-gnueabihf/debug/hellopp`
Hello, world! If there are still issues, I'll re-open this. |
So, I'm running into this.
Would print But the build would fail on getting the target list:
My user is part of the docker group:
Still debugging. |
Okay, it works fine without sudo I guess. Something with the build system is running the build as the wrong user. Weird error message in this case, but I guess that's the issue. |
Update: The CI is indeed running as the correct user, confirmed via "echo "$USER" before However, now, when I run as my own user, I get:
On Debian Testing. If I omit
Info:
Wonder if it's due to a somewhat old version of Debian... will try upgrading I guess since 10 is EOL. Build servers tend to live too long. :) |
The issue you're seeing is #724 |
This is a known issue upstream: cross-rs/cross#526
Because several of the tests require root privileges. But don't use sudo with cross. It fails due to a known issue upstream: cross-rs/cross#526
Because several of the tests require root privileges. But don't use sudo with cross. It fails due to a known issue upstream: cross-rs/cross#526
Because several of the tests require root privileges. But don't use sudo with cross. It fails due to a known issue upstream: cross-rs/cross#526
Because several of the tests require root privileges. But don't use sudo with cross. It fails due to a known issue upstream: cross-rs/cross#526
Because several of the tests require root privileges. But don't use sudo with cross. It fails due to a known issue upstream: cross-rs/cross#526
* Fix the mount tests As originally written by @kamalmarhubi in #231, these tests made clever use of Linux namespaces in order to run as unprivileged users. However, a subsequent kernel bug broke this functionality, and it hasn't been fixed even 6 years later. The tests have been skipped ever since. Get the tests to run again by removing the namespace stuff and requiring privileges instead. Also, remove the custom test harness. Now Nix will be compatible with tools like cargo-nextest. https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1659087 * Move the mount tests into the "test" program Now that we aren't using namespaces, they don't need their own program. * Use "sudo" to run tests on github workflows. Because several of the tests require root privileges. But don't use sudo with cross. It fails due to a known issue upstream: cross-rs/cross#526
Hey,
after installing cross, any attempt on using it for building terminates with
I tested this for different programs and different targets.
My environment:
Any idea on how to fix this is appreciated, thanks.
The text was updated successfully, but these errors were encountered: