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

Rust 1.18 regression: coinbaser 0.1.0 #40955

Closed
alexcrichton opened this Issue Mar 31, 2017 · 11 comments

Comments

Projects
None yet
5 participants
@alexcrichton
Copy link
Member

alexcrichton commented Mar 31, 2017

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?

@jethrogb

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link

patrickjm commented Apr 2, 2017

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

@brson

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member Author

alexcrichton commented Apr 3, 2017

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

This comment has been minimized.

Copy link

jmatraszek commented Apr 4, 2017

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

@alexcrichton

This comment has been minimized.

Copy link
Member Author

alexcrichton commented Apr 4, 2017

Thanks @jmatraszek!

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

@patrickjm

This comment has been minimized.

Copy link

patrickjm commented Apr 4, 2017

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

This comment has been minimized.

Copy link
Member Author

alexcrichton commented Apr 4, 2017

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

@jmatraszek

This comment has been minimized.

Copy link

jmatraszek commented Apr 4, 2017

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

This comment has been minimized.

Copy link
Member Author

alexcrichton commented Apr 4, 2017

Awesome thanks for the investigation @jmatraszek!

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

Auto merge of #3898 - jmatraszek:fix_rust_40955, r=alexcrichton
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

@bors bors closed this in #41166 Apr 12, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.