cc-rs icon indicating copy to clipboard operation
cc-rs copied to clipboard

test failures on arm64

Open plugwash opened this issue 4 years ago • 3 comments

Hi

A couple of rust-cc tests are failing on debian arm64. Other tests are passing

https://ci.debian.net/data/autopkgtest/testing/arm64/r/rust-cc/4984409/log.gz

---- gnu_flag_if_supported_cpp stdout ---- CXX_x86_64-unknown-linux-gnu = None CXX_x86_64_unknown_linux_gnu = None HOST_CXX = None CXX = None CXXFLAGS_x86_64-unknown-linux-gnu = None CXXFLAGS_x86_64_unknown_linux_gnu = None HOST_CXXFLAGS = None CXXFLAGS = Some("") CRATE_CC_NO_DEFAULTS = None CARGO_CFG_TARGET_FEATURE = None CXX_x86_64-unknown-linux-gnu = None CXX_x86_64_unknown_linux_gnu = None HOST_CXX = None CXX = None CXXFLAGS_x86_64-unknown-linux-gnu = None CXXFLAGS_x86_64_unknown_linux_gnu = None HOST_CXXFLAGS = None CXXFLAGS = Some("") CRATE_CC_NO_DEFAULTS = None CARGO_CFG_TARGET_FEATURE = None running: "c++" "-O2" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-o" "/tmp/tmp.xdOGMZFIKT/target/aarch64-unknown-linux-gnu/debug/gcc-test6LaYGs/foo.o" "-c" "foo.cpp" exit code: 0 AR_x86_64-unknown-linux-gnu = None AR_x86_64_unknown_linux_gnu = None HOST_AR = None AR = None running: "ar" "crs" "/tmp/tmp.xdOGMZFIKT/target/aarch64-unknown-linux-gnu/debug/gcc-test6LaYGs/libfoo.a" "/tmp/tmp.xdOGMZFIKT/target/aarch64-unknown-linux-gnu/debug/gcc-test6LaYGs/foo.o" exit code: 0 cargo:rustc-link-lib=static=foo cargo:rustc-link-search=native=/tmp/tmp.xdOGMZFIKT/target/aarch64-unknown-linux-gnu/debug/gcc-test6LaYGs CXXSTDLIB_x86_64-unknown-linux-gnu = None CXXSTDLIB_x86_64_unknown_linux_gnu = None HOST_CXXSTDLIB = None CXXSTDLIB = None cargo:rustc-link-lib=stdc++ thread 'gnu_flag_if_supported_cpp' panicked at 'didn't find "-std=c++11" in ["-O2", "-ffunction-sections", "-fdata-sections", "-fPIC", "-m64", "-o", "/tmp/tmp.xdOGMZFIKT/target/aarch64-unknown-linux-gnu/debug/gcc-test6LaYGs/foo.o", "-c", "foo.cpp"]', tests/support/mod.rs:106:13 stack backtrace: 0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt 1: core::fmt::write 2: std::io::Write::write_fmt 3: std::io::impls::<impl std::io::Write for alloc::boxed::Box<W>>::write_fmt 4: std::panicking::default_hook::{{closure}} 5: std::panicking::default_hook 6: std::panicking::rust_panic_with_hook 7: std::panicking::continue_panic_fmt 8: std::panicking::begin_panic_fmt 9: test::support::Execution::must_have at tests/support/mod.rs:106 10: test::gnu_flag_if_supported_cpp at tests/test.rs:329 11: test::gnu_flag_if_supported_cpp::{{closure}} at tests/test.rs:318 12: core::ops::function::FnOnce::call_once at /usr/src/rustc-1.40.0/src/libcore/ops/function.rs:227 13: <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once 14: __rust_maybe_catch_panic 15: test::run_test_in_process note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace.

---- gnu_flag_if_supported stdout ---- CC_x86_64-unknown-linux-gnu = None CC_x86_64_unknown_linux_gnu = None HOST_CC = None CC = None CFLAGS_x86_64-unknown-linux-gnu = None CFLAGS_x86_64_unknown_linux_gnu = None HOST_CFLAGS = None CFLAGS = Some("") CRATE_CC_NO_DEFAULTS = None CARGO_CFG_TARGET_FEATURE = None CC_x86_64-unknown-linux-gnu = None CC_x86_64_unknown_linux_gnu = None HOST_CC = None CC = None CFLAGS_x86_64-unknown-linux-gnu = None CFLAGS_x86_64_unknown_linux_gnu = None HOST_CFLAGS = None CFLAGS = Some("") CRATE_CC_NO_DEFAULTS = None CARGO_CFG_TARGET_FEATURE = None CC_x86_64-unknown-linux-gnu = None CC_x86_64_unknown_linux_gnu = None HOST_CC = None CC = None CFLAGS_x86_64-unknown-linux-gnu = None CFLAGS_x86_64_unknown_linux_gnu = None HOST_CFLAGS = None CFLAGS = Some("") CRATE_CC_NO_DEFAULTS = None CARGO_CFG_TARGET_FEATURE = None CC_x86_64-unknown-linux-gnu = None CC_x86_64_unknown_linux_gnu = None HOST_CC = None CC = None CFLAGS_x86_64-unknown-linux-gnu = None CFLAGS_x86_64_unknown_linux_gnu = None HOST_CFLAGS = None CFLAGS = Some("") CRATE_CC_NO_DEFAULTS = None CARGO_CFG_TARGET_FEATURE = None running: "cc" "-O2" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-v" "-o" "/tmp/tmp.xdOGMZFIKT/target/aarch64-unknown-linux-gnu/debug/gcc-testWqeD01/foo.o" "-c" "foo.c" exit code: 0 AR_x86_64-unknown-linux-gnu = None AR_x86_64_unknown_linux_gnu = None HOST_AR = None AR = None running: "ar" "crs" "/tmp/tmp.xdOGMZFIKT/target/aarch64-unknown-linux-gnu/debug/gcc-testWqeD01/libfoo.a" "/tmp/tmp.xdOGMZFIKT/target/aarch64-unknown-linux-gnu/debug/gcc-testWqeD01/foo.o" exit code: 0 cargo:rustc-link-lib=static=foo cargo:rustc-link-search=native=/tmp/tmp.xdOGMZFIKT/target/aarch64-unknown-linux-gnu/debug/gcc-testWqeD01 thread 'gnu_flag_if_supported' panicked at 'didn't find "-Wall" in ["-O2", "-ffunction-sections", "-fdata-sections", "-fPIC", "-m64", "-v", "-o", "/tmp/tmp.xdOGMZFIKT/target/aarch64-unknown-linux-gnu/debug/gcc-testWqeD01/foo.o", "-c", "foo.c"]', tests/support/mod.rs:106:13 stack backtrace: 0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt 1: core::fmt::write 2: std::io::Write::write_fmt 3: std::io::impls::<impl std::io::Write for alloc::boxed::Box<W>>::write_fmt 4: std::panicking::default_hook::{{closure}} 5: std::panicking::default_hook 6: std::panicking::rust_panic_with_hook 7: std::panicking::continue_panic_fmt 8: std::panicking::begin_panic_fmt 9: test::support::Execution::must_have at tests/support/mod.rs:106 10: test::gnu_flag_if_supported at tests/test.rs:310 11: test::gnu_flag_if_supported::{{closure}} at tests/test.rs:295 12: core::ops::function::FnOnce::call_once at /usr/src/rustc-1.40.0/src/libcore/ops/function.rs:227 13: <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once 14: __rust_maybe_catch_panic 15: test::run_test_in_process note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace.

Can anyone provide advice on how to debug this?

plugwash avatar Apr 14 '20 20:04 plugwash

This is caused by CFLAGS in the environment. The test either needs to be updated to remove that env var from the environment or the environment needs to have it removed. Either way though I don't think that this is a bug in this crate, so I'm going to close.

alexcrichton avatar Apr 15 '20 15:04 alexcrichton

"This is caused by CFLAGS in the environment."

In addition to the automated test I have also tested this locally by cloning https://github.com/alexcrichton/cc-rs and manually running cargo test, I got the same failures, no CC, CFLAGS or similar environment variables were set in the environment from which I manually ran cargo test.

This is happening on arm64 but not on amd64 so there is clearly some difference between the behaviour on the two architectures.

plugwash avatar Apr 19 '20 11:04 plugwash

Ok, sorry but I don't have time to dig into this right now, nor do I even have a machine to test on. If you can assist in debugging that would be greatly appreciated.

alexcrichton avatar Apr 21 '20 21:04 alexcrichton