rust-lang / libc

Raw bindings to platform APIs for Rust
https://docs.rs/libc
Apache License 2.0
2.07k stars 1.04k forks source link

libc-test does not compile -> can't test changes #615

Closed iddm closed 7 years ago

iddm commented 7 years ago

Can't compile the libc-test submodule to test my changes before pushing the commit to the pull-request.

~/bb/libc/libc-test$ cargo run
   Compiling libc-test v0.1.0 (file:///home/user/bb/libc/libc-test)
error: failed to run custom build command for `libc-test v0.1.0 (file:///home/user/bb/libc/libc-test)`
process didn't exit successfully: `/home/user/bb/libc/target/debug/build/libc-test-6b19f467209b82a4/build-script-build` (exit code: 101)
--- stdout
cargo:rerun-if-changed=../src/lib.rs
cargo:rerun-if-changed=../src/dox.rs
cargo:rerun-if-changed=../src/unix/mod.rs
cargo:rerun-if-changed=../src/macros.rs
cargo:rerun-if-changed=../src/unix/notbsd/mod.rs
cargo:rerun-if-changed=../src/unix/notbsd/linux/mod.rs
cargo:rerun-if-changed=../src/unix/notbsd/linux/other/mod.rs
cargo:rerun-if-changed=../src/unix/notbsd/linux/other/b64/mod.rs
cargo:rerun-if-changed=../src/unix/notbsd/linux/other/b64/x86_64.rs
OPT_LEVEL = Some("0")
HOST = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
CC_x86_64-unknown-linux-gnu = None
CC_x86_64_unknown_linux_gnu = None
HOST_CC = None
CC = None
HOST = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
CFLAGS_x86_64-unknown-linux-gnu = None
CFLAGS_x86_64_unknown_linux_gnu = None
HOST_CFLAGS = None
CFLAGS = None
PROFILE = Some("debug")
running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-m64" "-Wall" "-Wextra" "-Werror" "-Wno-unused-parameter" "-Wno-type-limits" "-Wno-deprecated-declarations" "-D_GNU_SOURCE" "-o" "/home/user/bb/libc/target/debug/build/libc-test-c50f1815047c5006/out/all.o" "-c" "/home/user/bb/libc/target/debug/build/libc-test-c50f1815047c5006/out/all.c"
cargo:warning=/home/user/bb/libc/target/debug/build/libc-test-c50f1815047c5006/out/all.c:5847:55: error: ‘SOL_NETBEUI’ undeclared here (not in a function)
cargo:warning=             static int __test_const_SOL_NETBEUI_val = SOL_NETBEUI;
cargo:warning=                                                       ^
cargo:warning=/home/user/bb/libc/target/debug/build/libc-test-c50f1815047c5006/out/all.c:5853:51: error: ‘SOL_LLC’ undeclared here (not in a function)
cargo:warning=             static int __test_const_SOL_LLC_val = SOL_LLC;
cargo:warning=                                                   ^
cargo:warning=/home/user/bb/libc/target/debug/build/libc-test-c50f1815047c5006/out/all.c:5859:52: error: ‘SOL_DCCP’ undeclared here (not in a function)
cargo:warning=             static int __test_const_SOL_DCCP_val = SOL_DCCP;
cargo:warning=                                                    ^
cargo:warning=/home/user/bb/libc/target/debug/build/libc-test-c50f1815047c5006/out/all.c:5865:55: error: ‘SOL_NETLINK’ undeclared here (not in a function)
cargo:warning=             static int __test_const_SOL_NETLINK_val = SOL_NETLINK;
cargo:warning=                                                       ^
cargo:warning=/home/user/bb/libc/target/debug/build/libc-test-c50f1815047c5006/out/all.c:5871:52: error: ‘SOL_TIPC’ undeclared here (not in a function)
cargo:warning=             static int __test_const_SOL_TIPC_val = SOL_TIPC;
cargo:warning=                                                    ^
cargo:warning=/home/user/bb/libc/target/debug/build/libc-test-c50f1815047c5006/out/all.c:10912:58: error: ‘EPOLLEXCLUSIVE’ undeclared here (not in a function)
cargo:warning=             static int __test_const_EPOLLEXCLUSIVE_val = EPOLLEXCLUSIVE;
cargo:warning=                                                          ^
cargo:warning=/home/user/bb/libc/target/debug/build/libc-test-c50f1815047c5006/out/all.c:13484:53: error: ‘SOL_RXRPC’ undeclared here (not in a function)
cargo:warning=             static int __test_const_SOL_RXRPC_val = SOL_RXRPC;
cargo:warning=                                                     ^
cargo:warning=/home/user/bb/libc/target/debug/build/libc-test-c50f1815047c5006/out/all.c:13490:56: error: ‘SOL_PPPOL2TP’ undeclared here (not in a function)
cargo:warning=             static int __test_const_SOL_PPPOL2TP_val = SOL_PPPOL2TP;
cargo:warning=                                                        ^
cargo:warning=/home/user/bb/libc/target/debug/build/libc-test-c50f1815047c5006/out/all.c:13496:57: error: ‘SOL_BLUETOOTH’ undeclared here (not in a function)
cargo:warning=             static int __test_const_SOL_BLUETOOTH_val = SOL_BLUETOOTH;
cargo:warning=                                                         ^
cargo:warning=/home/user/bb/libc/target/debug/build/libc-test-c50f1815047c5006/out/all.c:13502:54: error: ‘SOL_PNPIPE’ undeclared here (not in a function)
cargo:warning=             static int __test_const_SOL_PNPIPE_val = SOL_PNPIPE;
cargo:warning=                                                      ^
cargo:warning=/home/user/bb/libc/target/debug/build/libc-test-c50f1815047c5006/out/all.c:13508:51: error: ‘SOL_RDS’ undeclared here (not in a function)
cargo:warning=             static int __test_const_SOL_RDS_val = SOL_RDS;
cargo:warning=                                                   ^
cargo:warning=/home/user/bb/libc/target/debug/build/libc-test-c50f1815047c5006/out/all.c:13514:52: error: ‘SOL_IUCV’ undeclared here (not in a function)
cargo:warning=             static int __test_const_SOL_IUCV_val = SOL_IUCV;
cargo:warning=                                                    ^
cargo:warning=/home/user/bb/libc/target/debug/build/libc-test-c50f1815047c5006/out/all.c:13520:52: error: ‘SOL_CAIF’ undeclared here (not in a function)
cargo:warning=             static int __test_const_SOL_CAIF_val = SOL_CAIF;
cargo:warning=                                                    ^
cargo:warning=/home/user/bb/libc/target/debug/build/libc-test-c50f1815047c5006/out/all.c:13526:51: error: ‘SOL_ALG’ undeclared here (not in a function)
cargo:warning=             static int __test_const_SOL_ALG_val = SOL_ALG;
cargo:warning=                                                   ^
cargo:warning=/home/user/bb/libc/target/debug/build/libc-test-c50f1815047c5006/out/all.c:13532:51: error: ‘SOL_NFC’ undeclared here (not in a function)
cargo:warning=             static int __test_const_SOL_NFC_val = SOL_NFC;
cargo:warning=                                                   ^
cargo:warning=/home/user/bb/libc/target/debug/build/libc-test-c50f1815047c5006/out/all.c:18121:59: error: ‘CLONE_NEWCGROUP’ undeclared here (not in a function)
cargo:warning=             static int __test_const_CLONE_NEWCGROUP_val = CLONE_NEWCGROUP;
cargo:warning=                                                           ^
exit code: 1

command did not execute successfully, got: exit code: 1

--- stderr
thread 'main' panicked at 'explicit panic', /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/gcc-0.3.46/src/lib.rs:1200
note: Run with `RUST_BACKTRACE=1` for a backtrace.

Don't understand what to do here.

Ubuntu 16.04, x64.

alexcrichton commented 7 years ago

Some of these constants may be newer than what your system has available perhaps? You could also try running tests in the containers in the ci/docker folder to do the same thing that CI does.

Uplifting commented 7 years ago

Looks like your Linux machine is <4.6? These constants were added in >= 4.6 (see http://man7.org/linux/man-pages/man2/unshare.2.html for example).

iddm commented 7 years ago

@Uplifting it may be so, can check this tomorrow. If so - I can't run test then?

alexcrichton commented 7 years ago

I'm going to close this because this was probably just not-quite-new-enough headers locally