Skip to content
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

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

Closed
RalfJung opened this issue Aug 18, 2017 · 4 comments
Labels
C-bug Category: This is a bug.

Comments

@RalfJung
Copy link
Member

RalfJung commented Aug 18, 2017

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

@ids1024
Copy link
Contributor

ids1024 commented Aug 18, 2017

I noticed this too. I guess xargo is ignoring Rust's Cargo.lock file? Perhaps that is something that should be fixed in xargo.

Of course, the crate should be updated anyway, but that might prevent future issues (although it isn't a common issue).

@RalfJung
Copy link
Member Author

RalfJung commented Aug 18, 2017

The Cargo.lock is not part of the rust-src tarball, so xargo has no way to know which version rustc used.

@ids1024
Copy link
Contributor

ids1024 commented Aug 18, 2017

Oh; in that case, perhaps the Cargo.lock file should be added to rust-src as well.

Again this isn't a common issue, so it's perhaps not that important; but including Cargo.lock in rust-src and having xargo respect it is probably "correct" behavior.

@RalfJung
Copy link
Member Author

@ids1024 You may like this: japaric/xargo#166

RalfJung added a commit to RalfJung/rust that referenced this issue Sep 2, 2017
Use gcc::Build rather than deprecated gcc::Config.
Fixes rust-lang#43973
bors added a commit that referenced this issue Sep 4, 2017
use gcc::Build rather than deprecated gcc::Config

I did `cargo update -p gcc` to upgrade only this package. Is there further process that should be follwoed when updating a build dependency from crates.io?

r? @alexcrichton
Fixes #43973
bors added a commit that referenced this issue Sep 5, 2017
use gcc::Build rather than deprecated gcc::Config

I did `cargo update -p gcc` to upgrade only this package. Is there further process that should be follwoed when updating a build dependency from crates.io?

r? @alexcrichton
Fixes #43973
bors added a commit that referenced this issue Sep 6, 2017
use gcc::Build rather than deprecated gcc::Config

I did `cargo update -p gcc` to upgrade only this package. Is there further process that should be follwoed when updating a build dependency from crates.io?

r? @alexcrichton
Fixes #43973
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug.
Projects
None yet
Development

No branches or pull requests

3 participants