rust-lang / cc-rs

Rust library for build scripts to compile C/C++ code into a Rust library
https://docs.rs/cc
Apache License 2.0
1.87k stars 450 forks source link

Breaks build of cargo-c #1040

Closed groovybits closed 6 months ago

groovybits commented 6 months ago

I tracked this error down, suddenly my cargo-c build fails and it seems to be the cc crate dep for it being updated within the last few hours...

(This worked a few hours ago)

+ run_with_scl cargo install cargo-c --root=/root/rpmbuild/BUILD/opt/rsprobe
+ scl enable rh-python38 devtoolset-11 -- cargo install cargo-c --root=/root/rpmbuild/BUILD/opt/rsprobe
    Updating crates.io index
  Downloaded cargo-c v0.9.31+cargo-0.78.0
  Downloaded 1 crate (48.8 KB) in 0.29s
  Installing cargo-c v0.9.31+cargo-0.78.0
    Updating crates.io index
  Downloaded anstream v0.6.13
  Downloaded anstyle-parse v0.2.3
  Downloaded anstyle v1.0.6
  Downloaded adler v1.0.2
  Downloaded annotate-snippets v0.10.2
  Downloaded allocator-api2 v0.2.18
  Downloaded base64ct v1.6.0
  Downloaded gix-bitmap v0.2.11
  Downloaded ct-codecs v1.1.1
  Downloaded crossbeam-deque v0.8.5
  Downloaded serde_ignored v0.1.10
  Downloaded serde_spanned v0.6.5
  Downloaded digest v0.10.7
  Downloaded gix-object v0.40.1
  Downloaded gix-negotiate v0.11.1
  Downloaded same-file v1.0.6
  Downloaded gix-index v0.28.2
  Downloaded libloading v0.8.3
  Downloaded sha2 v0.10.8
  Downloaded ordered-float v2.10.1
  Downloaded pkg-config v0.3.30
  Downloaded thiserror v1.0.58
  Downloaded subtle v2.5.0
  Downloaded der v0.7.9
  Downloaded num-conv v0.1.0
  Downloaded unicode-bom v2.0.3
  Downloaded tar v0.4.40
  Downloaded nom v7.1.3
  Downloaded maybe-async v0.2.10
  Downloaded memchr v2.7.2
  Downloaded openssl-probe v0.1.5
  Downloaded lazycell v1.3.0
  Downloaded overload v0.1.1
  Downloaded opener v0.6.1
  Downloaded lazy_static v1.4.0
  Downloaded kstring v2.0.0
  Downloaded semver v1.0.22
  Downloaded unicase v2.7.0
  Downloaded itoa v1.0.11
  Downloaded is-terminal v0.4.12
  Downloaded unicode-width v0.1.11
  Downloaded terminal_size v0.3.0
  Downloaded fiat-crypto v0.2.7
  Downloaded sec1 v0.7.3
  Downloaded zeroize v1.7.0
  Downloaded supports-hyperlinks v2.1.0
  Downloaded scopeguard v1.2.0
  Downloaded regex-automata v0.1.10
  Downloaded rusqlite v0.30.0
  Downloaded num_threads v0.1.7
  Downloaded regex v1.10.4
  Downloaded version_check v0.9.4
  Downloaded gix-tempfile v12.0.1
  Downloaded tracing-log v0.2.0
  Downloaded rustix v0.38.32
  Downloaded regex-automata v0.4.6
  Downloaded gix-worktree v0.29.1
  Downloaded group v0.13.0
  Downloaded gix-url v0.26.1
  Downloaded gix-pathspec v0.5.1
  Downloaded gix-prompt v0.8.4
  Downloaded gix-path v0.10.7
  Downloaded libc v0.2.153
  Downloaded linux-raw-sys v0.4.13
  Downloaded rfc6979 v0.4.0
  Downloaded libnghttp2-sys v0.1.10+1.61.0
  Downloaded hashlink v0.8.4
  Downloaded globset v0.4.14
  Downloaded gix-traverse v0.36.2
  Downloaded gix-ref v0.40.1
  Downloaded gix-protocol v0.43.1
  Downloaded once_cell v1.19.0
  Downloaded http-auth v0.1.9
  Downloaded sharded-slab v0.1.7
  Downloaded walkdir v2.5.0
  Downloaded typenum v1.17.0
  Downloaded toml_datetime v0.6.5
  Downloaded toml v0.8.12
  Downloaded toml v0.5.11
  Downloaded libz-sys v1.1.16
  Downloaded libsqlite3-sys v0.27.0
  Downloaded memmap2 v0.9.4
  Downloaded url v2.5.0
  Downloaded ignore v0.4.22
  Downloaded hmac v0.12.1
  Downloaded gix-transport v0.40.1
  Downloaded unicode-bidi v0.3.15
  Downloaded unicode-normalization v0.1.23
  Downloaded tracing-core v0.1.32
  Downloaded toml_edit v0.21.1
  Downloaded gix-pack v0.46.1
  Downloaded toml_edit v0.22.12
  Downloaded time v0.3.36
  Downloaded tracing v0.1.40
  Downloaded hashbrown v0.12.3
  Downloaded tinyvec v1.6.0
  Downloaded gix-odb v0.56.1
  Downloaded socket2 v0.5.6
  Downloaded hashbrown v0.14.3
  Downloaded curl-sys v0.4.72+curl-8.6.0
  Downloaded im-rc v15.1.0
  Downloaded idna v0.5.0
  Downloaded hkdf v0.12.4
  Downloaded zerocopy v0.7.32
  Downloaded winnow v0.6.6
  Downloaded winnow v0.5.40
  Downloaded vcpkg v0.2.15
  Downloaded tracing-subscriber v0.3.18
  Downloaded syn v2.0.60
  Downloaded syn v1.0.109
  Downloaded cargo v0.78.1
  Downloaded hex v0.4.3
  Downloaded heck v0.5.0
  Downloaded gix-submodule v0.7.1
  Downloaded gix-revwalk v0.11.1
  Downloaded gix-refspec v0.21.1
  Downloaded libgit2-sys v0.16.2+1.7.2
  Downloaded humantime v2.1.0
  Downloaded heck v0.4.1
  Downloaded gix-sec v0.10.6
  Downloaded gix-revision v0.25.1
  Downloaded gix-packetline v0.17.5
  Downloaded unicode-ident v1.0.12
  Downloaded sized-chunks v0.6.5
  Downloaded home v0.5.9
  Downloaded glob v0.3.1
  Downloaded gix-trace v0.1.9
  Downloaded gix-packetline-blocking v0.17.4
  Downloaded unicode-xid v0.2.4
  Downloaded encoding_rs v0.8.34
  Downloaded libssh2-sys v0.3.0
  Downloaded strsim v0.11.1
  Downloaded static_assertions v1.1.0
  Downloaded smallvec v1.13.2
  Downloaded pasetors v0.6.8
  Downloaded gix-utils v0.1.12
  Downloaded tempfile v3.10.1
  Downloaded time-macros v0.2.18
  Downloaded thiserror-impl v1.0.58
  Downloaded rustfix v0.8.1
  Downloaded rand_xoshiro v0.6.0
  Downloaded pin-project-lite v0.2.14
  Downloaded percent-encoding v2.3.1
  Downloaded pem-rfc7468 v0.7.0
  Downloaded pathdiff v0.2.1
  Downloaded parking_lot_core v0.9.9
  Downloaded parking_lot v0.12.1
  Downloaded p384 v0.13.0
  Downloaded os_info v3.8.2
  Downloaded miniz_oxide v0.7.2
  Downloaded itertools v0.12.1
  Downloaded serde v1.0.198
  Downloaded gix-validate v0.8.4
  Downloaded gix-quote v0.4.12
  Downloaded tracing-attributes v0.1.27
  Downloaded matchers v0.1.0
  Downloaded log v0.4.21
  Downloaded lock_api v0.4.11
  Downloaded indexmap v2.2.6
  Downloaded serde-value v0.7.0
  Downloaded serde-untagged v0.1.5
  Downloaded regex-syntax v0.6.29
  Downloaded thread_local v1.1.8
  Downloaded regex-syntax v0.8.3
  Downloaded orion v0.17.6
  Downloaded utf8parse v0.2.1
  Downloaded tinyvec_macros v0.1.1
  Downloaded time-core v0.1.2
  Downloaded spki v0.7.3
  Downloaded signature v2.2.0
  Downloaded shell-words v1.1.0
  Downloaded gix v0.57.1
  Downloaded bstr v1.9.1
  Downloaded git2 v0.18.3
  Downloaded cbindgen v0.26.0
  Downloaded nu-ansi-term v0.46.0
  Downloaded rand_core v0.6.4
  Downloaded rand_chacha v0.3.1
  Downloaded rand v0.8.5
  Downloaded quote v1.0.36
  Downloaded prodash v28.0.0
  Downloaded proc-macro2 v1.0.81
  Downloaded primeorder v0.13.6
  Downloaded ppv-lite86 v0.2.17
  Downloaded powerfmt v0.2.0
  Downloaded pkcs8 v0.10.2
  Downloaded openssl-sys v0.9.102
  Downloaded num-traits v0.2.18
  Downloaded minimal-lexical v0.2.1
  Downloaded shell-escape v0.1.5
  Downloaded clap_builder v4.5.2
  Downloaded sha1_smol v1.0.0
  Downloaded sha1 v0.10.6
  Downloaded serde_json v1.0.116
  Downloaded arc-swap v1.7.1
  Downloaded jobserver v0.1.30
  Downloaded indexmap v1.9.3
  Downloaded ryu v1.0.17
  Downloaded gix-config v0.33.1
  Downloaded flate2 v1.0.28
  Downloaded elliptic-curve v0.13.8
  Downloaded curl v0.4.46
  Downloaded crypto-bigint v0.5.5
  Downloaded crossbeam-channel v0.5.12
  Downloaded cc v1.0.95
  Downloaded gix-filter v0.8.1
  Downloaded getrandom v0.2.14
  Downloaded ed25519-compact v2.1.1
  Downloaded crossbeam-utils v0.8.19
  Downloaded clap v4.5.4
  Downloaded bytes v1.6.0
  Downloaded base64 v0.21.7
  Downloaded anyhow v1.0.82
  Downloaded gix-fs v0.9.1
  Downloaded gix-features v0.37.2
  Downloaded gix-diff v0.39.1
  Downloaded gix-attributes v0.21.1
  Downloaded faster-hex v0.9.0
  Downloaded erased-serde v0.4.4
  Downloaded ecdsa v0.16.9
  Downloaded crypto-common v0.1.6
  Downloaded cargo-util v0.2.10
  Downloaded gix-macros v0.1.4
  Downloaded gix-lock v12.0.1
  Downloaded gix-ignore v0.10.1
  Downloaded gix-hash v0.14.2
  Downloaded gix-glob v0.15.1
  Downloaded gix-discover v0.28.1
  Downloaded gix-date v0.8.5
  Downloaded gix-credentials v0.23.1
  Downloaded gix-config-value v0.14.6
  Downloaded gix-commitgraph v0.23.2
  Downloaded gix-command v0.3.6
  Downloaded gix-chunk v0.4.8
  Downloaded git2-curl v0.19.0
  Downloaded generic-array v0.14.7
  Downloaded form_urlencoded v1.2.1
  Downloaded filetime v0.2.23
  Downloaded ff v0.13.0
  Downloaded fallible-streaming-iterator v0.1.9
  Downloaded fallible-iterator v0.3.0
  Downloaded errno v0.3.8
  Downloaded either v1.11.0
  Downloaded crossbeam-epoch v0.9.18
  Downloaded color-print-proc-macro v0.3.5
  Downloaded clru v0.6.1
  Downloaded clap_derive v4.5.4
  Downloaded base16ct v0.2.0
  Downloaded gix-hashtable v0.5.2
  Downloaded fastrand v2.0.2
  Downloaded equivalent v1.0.1
  Downloaded deranged v0.3.11
  Downloaded const-oid v0.9.6
  Downloaded clap_lex v0.7.0
  Downloaded crc32fast v1.4.0
  Downloaded crates-io v0.40.0
  Downloaded cargo-credential-libsecret v0.4.3
  Downloaded serde_derive v1.0.198
  Downloaded gix-actor v0.29.1
  Downloaded colorchoice v1.0.0
  Downloaded cargo-util-schemas v0.2.0
  Downloaded cpufeatures v0.2.12
  Downloaded color-print v0.3.5
  Downloaded cfg-if v1.0.0
  Downloaded cargo-platform v0.1.8
  Downloaded cargo-credential v0.4.4
  Downloaded bytesize v1.3.0
  Downloaded btoi v0.4.3
  Downloaded block-buffer v0.10.4
  Downloaded autocfg v1.2.0
  Downloaded anstyle-query v1.0.2
  Downloaded bitmaps v2.1.0
  Downloaded bitflags v2.5.0
  Downloaded aho-corasick v1.1.3
  Downloaded ahash v0.8.11
  Downloaded 275 crates (36.6 MB) in 2.36s (largest was `libsqlite3-sys` at 4.9 MB)
   Compiling libc v0.2.153
   Compiling proc-macro2 v1.0.81
   Compiling unicode-ident v1.0.12
   Compiling cfg-if v1.0.0
   Compiling once_cell v1.19.0
   Compiling pkg-config v0.3.30
   Compiling vcpkg v0.2.15
   Compiling quote v1.0.36
   Compiling syn v2.0.60
   Compiling thiserror v1.0.58
   Compiling memchr v2.7.2
   Compiling autocfg v1.2.0
   Compiling jobserver v0.1.30
   Compiling version_check v0.9.4
   Compiling cc v1.0.95
   Compiling aho-corasick v1.1.3
   Compiling serde v1.0.198
   Compiling regex-syntax v0.8.3
   Compiling libz-sys v1.1.16
error: linking with `cc` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="/root/rpmbuild/BUILD/opt/rsprobe/lib/rustlib/x86_64-unknown-linux-gnu/bin:/opt/rh/devtoolset-11/root/usr/bin:/opt/rh/rh-python38/root/usr/local/bin:/opt/rh/rh-python38/root/usr/bin:/root/rpmbuild/BUILD/opt/rsprobe/bin:/sbin:/bin:/usr/sbin:/usr/bin" VSLANG="1033" "cc" "-m64" "/tmp/rustcfI5vaP/symbols.o" "/tmp/cargo-installYp6wWw/release/build/libz-sys-80c7d13234e9f222/build_script_build-80c7d13234e9f222.build_script_build.796d2b1f6f8fb703-cgu.0.rcgu.o" "/tmp/cargo-installYp6wWw/release/build/libz-sys-80c7d13234e9f222/build_script_build-80c7d13234e9f222.4h26726tsgrxi39w.rcgu.o" "-Wl,--as-needed" "-L" "/tmp/cargo-installYp6wWw/release/deps" "-L" "/root/rpmbuild/BUILD/opt/rsprobe/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/tmp/cargo-installYp6wWw/release/deps/libvcpkg-670d6452f2dc6653.rlib" "/tmp/cargo-installYp6wWw/release/deps/libcc-65d12df37917e9ec.rlib" "/tmp/cargo-installYp6wWw/release/deps/libjobserver-c5907962df4e7ec9.rlib" "/tmp/cargo-installYp6wWw/release/deps/liblibc-d5c78ef4afd0dc1d.rlib" "/tmp/cargo-installYp6wWw/release/deps/libonce_cell-9b09546715cabf3f.rlib" "/tmp/cargo-installYp6wWw/release/deps/libpkg_config-24e5a3f9cab3ca66.rlib" "/root/rpmbuild/BUILD/opt/rsprobe/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-6e3078511c661ac3.rlib" "/root/rpmbuild/BUILD/opt/rsprobe/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-252c22ad03c975c9.rlib" "/root/rpmbuild/BUILD/opt/rsprobe/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-d80cad399a4d0390.rlib" "/root/rpmbuild/BUILD/opt/rsprobe/lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-27491650d14ec48b.rlib" "/root/rpmbuild/BUILD/opt/rsprobe/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-97d68acfa4555965.rlib" "/root/rpmbuild/BUILD/opt/rsprobe/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-c70b304f6ac84900.rlib" "/root/rpmbuild/BUILD/opt/rsprobe/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-d55f2ec1b1801f29.rlib" "/root/rpmbuild/BUILD/opt/rsprobe/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-0b96f850bca44a32.rlib" "/root/rpmbuild/BUILD/opt/rsprobe/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-ee200428a02d516d.rlib" "/root/rpmbuild/BUILD/opt/rsprobe/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-53d84a0642c19f2b.rlib" "/root/rpmbuild/BUILD/opt/rsprobe/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-217c01f7aaf0f8d4.rlib" "/root/rpmbuild/BUILD/opt/rsprobe/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-2b97858586af9abb.rlib" "/root/rpmbuild/BUILD/opt/rsprobe/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-cc333506f95be41d.rlib" "/root/rpmbuild/BUILD/opt/rsprobe/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-690e7438295ce0c8.rlib" "/root/rpmbuild/BUILD/opt/rsprobe/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-c9c6c96eccfdab53.rlib" "/root/rpmbuild/BUILD/opt/rsprobe/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-cb895a9d9d73a7fa.rlib" "/root/rpmbuild/BUILD/opt/rsprobe/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-433bd1aab5f6d647.rlib" "/root/rpmbuild/BUILD/opt/rsprobe/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-5f8e0208f8278cbc.rlib" "/root/rpmbuild/BUILD/opt/rsprobe/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-1088ecd7666b60f4.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/root/rpmbuild/BUILD/opt/rsprobe/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/tmp/cargo-installYp6wWw/release/build/libz-sys-80c7d13234e9f222/build_script_build-80c7d13234e9f222" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,--strip-debug" "-nodefaultlibs"
  = note: /opt/rh/devtoolset-11/root/usr/libexec/gcc/x86_64-redhat-linux/11/ld: /tmp/cargo-installYp6wWw/release/deps/libjobserver-c5907962df4e7ec9.rlib(jobserver-c5907962df4e7ec9.jobserver.70cb6ff8d0cd015c-cgu.3.rcgu.o): in function `jobserver::imp::non_blocking_read':
          jobserver.70cb6ff8d0cd015c-cgu.3:(.text._ZN9jobserver3imp17non_blocking_read17h2ea775944709199dE+0x7b): undefined reference to `preadv2'
          collect2: error: ld returned 1 exit status

  = note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link
  = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-link-lib)

error: could not compile `libz-sys` (build script) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: failed to compile `cargo-c v0.9.31+cargo-0.78.0`, intermediate artifacts can be found at `/tmp/cargo-installYp6wWw`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
error: Bad exit status from /var/tmp/rpm-tmp.wcJLqf (%build)
groovybits commented 6 months ago

This fixes cargo-c...

cc = "=1.0.94"  # Ensures exactly version 1.0.94 is used
NobodyXu commented 6 months ago

Yeah this is the same issue as #1039 , closed since it is duplicate