Skip to content

Rust 1.18 regression: coinbaser 0.1.0 #40955

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
alexcrichton opened this issue Mar 31, 2017 · 11 comments · Fixed by #41166
Closed

Rust 1.18 regression: coinbaser 0.1.0 #40955

alexcrichton opened this issue Mar 31, 2017 · 11 comments · Fixed by #41166
Assignees
Labels
P-high High priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly.
Milestone

Comments

@alexcrichton
Copy link
Member

Reported on cargobomb

boom! running `docker start -a fcd992283fd7ae3f00c77dc9c371733b58ef79cf654f4113f69b8555e73a9612`
kablam!    Compiling coinbaser v0.1.0 (file:///source)
kablam! error[E0432]: unresolved import `hyper::client::Client`
kablam!  --> src/coinbaser.rs:5:5
kablam!   |
kablam! 5 | use hyper::client::Client;
kablam!   |     ^^^^^^^^^^^^^^^^^^^^^ Maybe a missing `extern crate hyper;`?
kablam! 
kablam! error[E0432]: unresolved import `hyper::status::StatusCode`
kablam!  --> src/coinbaser.rs:6:5
kablam!   |
kablam! 6 | use hyper::status::StatusCode;
kablam!   |     ^^^^^^^^^^^^^^^^^^^^^^^^^ Maybe a missing `extern crate hyper;`?
kablam! 
kablam! error[E0432]: unresolved import `hyper::Url`
kablam!  --> src/coinbaser.rs:7:5
kablam!   |
kablam! 7 | use hyper::Url;
kablam!   |     ^^^^^^^^^^ Maybe a missing `extern crate hyper;`?
kablam! 
kablam! error[E0432]: unresolved import `error::Error`
kablam!  --> src/coinbaser.rs:9:5
kablam!   |
kablam! 9 | use error::Error as _CoinError;
kablam!   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ Did you mean `std::error`?
kablam! 
kablam! error: main function not found
kablam! 
kablam! error: aborting due to 5 previous errors
kablam! 
kablam! error: Could not compile `coinbaser`.
kablam! 

Unfortunately the source is not available, but @patrickjm can you perhaps help reproduce?

@alexcrichton alexcrichton added the regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. label Mar 31, 2017
@jethrogb
Copy link
Contributor

jethrogb commented Mar 31, 2017

What do you mean source is not available? How did you find the regression in the first place?

@brson
Copy link
Contributor

brson commented Apr 1, 2017

@jethrogb I mean that I can't find the git repo. The source can be acquired from the published crate tarball.

Edit: er, I didn't file this bug, but that's what @alexcrichton meant.

@patrickjm
Copy link

The repo has been deleted for some time now - I tried to delete it from cargo but that's not allowed.

@brson
Copy link
Contributor

brson commented Apr 2, 2017

Should probably still be investigated, unless @patrickjm doesn't want us testing his yanked crate. We'll have to grab it from crates.io.

I wonder if maybe cargobomb shouldn't test yanked crates.

@alexcrichton
Copy link
Member Author

This is a regression in Cargo. With a Cargo.toml that looks like:

[project]
name = "foo"

[[bin]]
name = "foo"

And files at src/main.rs and src/foo.rs on stable Cargo will compile src/main.rs, on beta Cargo will compile src/foo.rs instead.

cc @jmatraszek, is this related to rust-lang/cargo#3609 perhaps?

@jmatraszek
Copy link

Hi @alexcrichton, will investigate this today, but looks like it is related.

@brson brson added the P-high High priority label Apr 4, 2017
@alexcrichton
Copy link
Member Author

Thanks @jmatraszek!

@brson brson added the T-tools label Apr 4, 2017
@patrickjm
Copy link

Sorry about the hassle guys. I removed it because I didn't want my useless and dead project polluting things up, but that just caused more trouble!

No worries about testing my yanked crate. @brson

@alexcrichton
Copy link
Member Author

@patrickjm oh no worries! This crate helped us detect a regression and what's what we're worried about :)

@jmatraszek
Copy link

Hi @alexcrichton,
I think this was caused by this: https://github.com/rust-lang/cargo/blob/master/src/cargo/util/toml.rs#L1367, but it worked because of the bug I fixed in 3609 (cargo always assumed src/main.rs as a source file for a bin target).

You can find the proposed fix in rust-lang/cargo#3898. I tried to get rid of quick fixes and implement a full featured solution for inferring bin target's source file paths. Please review the inferring logic — I am not 100% sure that it covers all cargo's usecases, but it seems reasonable for me.

@alexcrichton
Copy link
Member Author

Awesome thanks for the investigation @jmatraszek!

bors added a commit to rust-lang/cargo that referenced this issue Apr 5, 2017
Fix rust-lang/rust 40955

Proposed fix for rust-lang/rust#40955.

I could also work on adding some additional tests, so we have all cases covered and automatically tested.
alexcrichton added a commit to alexcrichton/rust that referenced this issue Apr 8, 2017
@alexcrichton alexcrichton modified the milestone: 1.18 Apr 10, 2017
frewsxcv added a commit to frewsxcv/rust that referenced this issue Apr 12, 2017
frewsxcv added a commit to frewsxcv/rust that referenced this issue Apr 12, 2017
TimNN added a commit to TimNN/rust that referenced this issue Apr 12, 2017
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
P-high High priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants