Skip to content

libstd, liballoc_jemalloc fail to build with xargo due to use of deprecated gcc::Config #43973

Closed
@RalfJung

Description

@RalfJung

Trying to build the latest libstd outside of the rustc build itself (i.e., using xargo and the rust-src component) results in warnings and build failures:

warning: use of deprecated item: gcc::Config has been renamed to gcc::Build
    --> /home/r/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/rustc/compiler_builtins_shim/../../libcompiler_builtins/build.rs:4011:24
     |
4011 |         let cfg = &mut gcc::Config::new();
     |                        ^^^^^^^^^^^^^^^^
     |
     = note: #[warn(deprecated)] on by default

error: use of deprecated item: gcc::Config has been renamed to gcc::Build
  --> /home/r/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd/build.rs:80:20
   |
80 |     let compiler = gcc::Config::new().get_compiler();
   |                    ^^^^^^^^^^^^^^^^
   |
note: lint level defined here
  --> /home/r/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd/build.rs:11:9
   |
11 | #![deny(warnings)]
   |         ^^^^^^^^
   = note: #[deny(deprecated)] implied by #[deny(warnings)]

error: use of deprecated item: gcc::Config has been renamed to gcc::Build
  --> /home/r/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/liballoc_jemalloc/build.rs:66:20
   |
66 |     let compiler = gcc::Config::new().get_compiler();
   |                    ^^^^^^^^^^^^^^^^
   |
note: lint level defined here
  --> /home/r/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/liballoc_jemalloc/build.rs:11:9
   |
11 | #![deny(warnings)]
   |         ^^^^^^^^
   = note: #[deny(deprecated)] implied by #[deny(warnings)]

error: use of deprecated item: gcc::Config has been renamed to gcc::Build
   --> /home/r/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/liballoc_jemalloc/build.rs:173:9
    |
173 |         gcc::Config::new()
    |         ^^^^^^^^^^^^^^^^

I think what happens is that the lock file in rustc itself makes rustc still use an older version of the gcc crate, but since that crate deprecated gcc::Config in a minor release, and since some crates in rustc have deny(warnings), the gcc minor version upgrade breaks the build here. libstd's Cargo.toml says gcc = "0.3.50", so cargo will happily use 0.3.52 instead.

I tried fixing this by using gcc::Build rather than gcc::Config in rustc itself, but then it complains that there is no Build in gcc. Seems like I have to find some way to upgrade the version of the gcc crate that rustc uses?

Cc @alexcrichton

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions