Skip to content

cargo check fails, cargo build fails, cargo build --release works #7015

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

Closed
uggwar opened this issue Jun 6, 2019 · 9 comments
Closed

cargo check fails, cargo build fails, cargo build --release works #7015

uggwar opened this issue Jun 6, 2019 · 9 comments
Labels
C-bug Category: bug

Comments

@uggwar
Copy link

uggwar commented Jun 6, 2019

Problem

cargo check on a project using serde fails the final linking, with a rather huge amount of undefine references. The same goes for debug build, but release works as expected.

Steps

  1. cargo build
  2. Output with error messages attached

Possible Solution(s)

Build with --release creates a working binary, but is slow and doesn't work as well with 'cargo watch -c' (my workflow...)

cargo +nightly check
cargo 1.37.0-nightly (545f354 2019-05-23)

Notes

cargo 1.35.0 (6f3e9c3 2019-04-04)
rustc 1.35.0 (3c235d560 2019-05-20)
stable-x86_64-unknown-linux-gnu (default)
Debian GNU/Linux 10 testing amd64

cargo_check_serde_output.txt

@uggwar uggwar added the C-bug Category: bug label Jun 6, 2019
@ehuss
Copy link
Contributor

ehuss commented Jun 6, 2019

Can you post a project or Cargo.toml that reproduces the problem?

@uggwar
Copy link
Author

uggwar commented Jun 7, 2019

lompe.tar.gz

@ehuss
Copy link
Contributor

ehuss commented Jun 7, 2019

Hm, I can't seem to find a way to reproduce it. Have you tried running cargo clean?

@uggwar
Copy link
Author

uggwar commented Jun 12, 2019

Yes, sure. Same error in the project I posted earlier.

@ehuss
Copy link
Contributor

ehuss commented Jun 17, 2019

Sorry, I'm not able to reproduce your issue, and I don't really see any clues which could explain it. You might get more help on one of the forums like URLO.

@ehuss
Copy link
Contributor

ehuss commented Jun 17, 2019

Oh, another thing you might try is disabling incremental compilation to see if that is the culprit. Set the environment variable CARGO_INCREMENTAL=0. There are a number of people reporting similar issues with undefined symbols related to incremental.

@uggwar
Copy link
Author

uggwar commented Jun 18, 2019

CARGO_INCREMENTAL=0 builds correctly! Thanks!

@Eh2406
Copy link
Contributor

Eh2406 commented Jun 23, 2019

Move to close?

@ehuss
Copy link
Contributor

ehuss commented Jun 24, 2019

Yep, hopefully the compiler team can wrangle it. People may follow rust-lang/rust#59535 for updates.

@ehuss ehuss closed this as completed Jun 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

3 participants