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

Update download dependencies #1523

Merged
merged 1 commit into from
Nov 4, 2018
Merged

Update download dependencies #1523

merged 1 commit into from
Nov 4, 2018

Conversation

pickfire
Copy link
Contributor

@pickfire pickfire commented Oct 8, 2018

- reqwest 0.9, fix rust-lang#1518
- hyper 0.12
callback(Event::DownloadContentLengthReceived(len.0 + resume_from))?;
if let Some(len) = res.headers().get(header::CONTENT_LENGTH) {
// TODO possible issues during unwrap?
let len = len.to_str().unwrap().parse::<u64>().unwrap() + resume_from;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of converting the header to a string and back?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

len is &reqwest::header::HeaderValue (not u64) there IIRC so I need to convert it to str and then parse it as u64.

Even though HeaderValue have HttpTryFrom but TryFrom is nigthly so not usable.

I removing the extra to_str but HeaderValue does not implement parse.

Maybe I might have missed something?

@ghost
Copy link

ghost commented Oct 28, 2018

tl;dr: ignore this. Just hitting rust-lang/rust#55376

Changing just this line in file src/download/Cargo.toml (with a checked out rustup.rs (latest) commit being at 3abd097)

-reqwest = { version = "0.8.4", optional = true }
+reqwest = { version = "0.9", optional = true }

causes an ICE

$ ./go
!! LD_LIBRARY_PATH=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:
!! Executing '/home/xftroxgpx/.cargo/bin/cargo' in pwd='/home/xftroxgpx/build/2nonpkgs/rust.stuff/rustup.rs/rustup.rs' with args: 'install --force'
warning: Using `cargo install` to install the binaries for the package in current working directory is deprecated, use `cargo install --path .` instead. Use `cargo build` if you want to simply build the package.
  Installing rustup v1.14.0 (/home/xftroxgpx/build/2nonpkgs/rust.stuff/rustup.rs/rustup.rs)
   Compiling hyper v0.12.13                                                     
thread 'main' panicked at 'librustc/hir/map/hir_id_validator.rs:31:             
HirIdValidator: The recorded owner of path segment super (id=36819) is ::server[0]::conn[0]::{{?}}[34] instead of ::server[0]::conn[0]::{{?}}[34]::{{?}}[0]
HirIdValidator: Same HirId ::server[0]::conn[0]::{{?}}[34]::{{?}}[0]/2 assigned for nodes path segment super (id=36819) and path segment spawn_all (id=88814)', librustc/util/bug.rs:47:26
note: Run with `RUST_BACKTRACE=1` for a backtrace.                              
                                                                                
error: internal compiler error: unexpected panic                                
                                                                                
note: the compiler unexpectedly panicked. this is a bug.                        
                                                                                
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
                                                                                
note: rustc 1.31.0-nightly (cae6efc37 2018-10-27) running on x86_64-unknown-linux-gnu
                                                                                
note: compiler flags: -C opt-level=3 --crate-type lib                           
                                                                                
note: some of the compiler flags provided by cargo are hidden                   
                                                                                
error: failed to compile `rustup v1.14.0 (/home/xftroxgpx/build/2nonpkgs/rust.stuff/rustup.rs/rustup.rs)`, intermediate artifacts can be found at `/home/xftroxgpx/build/2nonpkgs/rust.stuff/rustup.rs/rustup.rs/target`

Caused by:
  Could not compile `hyper`.

To learn more, run the command again with --verbose.
$ rustv
!! LD_LIBRARY_PATH=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:
!! Executing '/home/xftroxgpx/.cargo/bin/rustc' in pwd='/home/xftroxgpx' with args: '-vV'
rustc 1.31.0-nightly (cae6efc37 2018-10-27)
binary: rustc
commit-hash: cae6efc37d70ab7d353e6ab9ce229d59a65ed643
commit-date: 2018-10-27
host: x86_64-unknown-linux-gnu
release: 1.31.0-nightly
LLVM version: 8.0
!! LD_LIBRARY_PATH=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:
!! Executing '/home/xftroxgpx/.cargo/bin/cargo' in pwd='/home/xftroxgpx' with args: '-vV'
cargo 1.31.0-nightly (2d0863f65 2018-10-20)
release: 1.31.0
commit-hash: 2d0863f657e6f45159fc7412267eee3e659185e5
commit-date: 2018-10-20

Ah, it's already reported: rust-lang/rust#55376

@ghost
Copy link

ghost commented Oct 28, 2018

I've just tested this PR and it fixes #1518 for me.
Cheers!

some unrelated warnings though:

   Compiling reqwest v0.9.2                                                     
   Compiling download v0.4.0 (/home/xftroxgpx/build/2nonpkgs/rust.stuff/rustup.rs/rustup.rs/src/download)
   Compiling rustup-utils v1.14.0 (/home/xftroxgpx/build/2nonpkgs/rust.stuff/rustup.rs/rustup.rs/src/rustup-utils)
warning: use of deprecated item 'std::env::home_dir': This function's behavior is unexpected and probably not what you want. Consider using the home_dir function from https://crates.io/crates/dirs instead.
   --> src/rustup-utils/src/utils.rs:519:5                                      
    |                                                                           
519 |     ::std::env::home_dir()                                                
    |     ^^^^^^^^^^^^^^^^^^^^                                                  
    |                                                                           
    = note: #[warn(deprecated)] on by default                                   
                                                                                
   Compiling rustup-dist v1.14.0 (/home/xftroxgpx/build/2nonpkgs/rust.stuff/rustup.rs/rustup.rs/src/rustup-dist)
   Compiling rustup v1.14.0 (/home/xftroxgpx/build/2nonpkgs/rust.stuff/rustup.rs/rustup.rs)
warning: use of deprecated item 'std::env::home_dir': This function's behavior is unexpected and probably not what you want. Consider using the home_dir function from https://crates.io/crates/dirs instead.
   --> src/rustup-cli/self_update.rs:388:31                                     
    |                                                                           
388 |     let multirust_meta_path = env::home_dir().map(|d| d.join(".multirust"));
    |                               ^^^^^^^^^^^^^                               
    |                                                                           
    = note: #[warn(deprecated)] on by default                                   
                                                                                
warning: use of deprecated item 'std::env::home_dir': This function's behavior is unexpected and probably not what you want. Consider using the home_dir function from https://crates.io/crates/dirs instead.
   --> src/rustup-cli/self_update.rs:390:26                                     
    |                                                                           
390 |     let rustup_sh_path = env::home_dir().map(|d| d.join(".rustup"));      
    |                          ^^^^^^^^^^^^^                                    
                                                                                
    Finished release [optimized] target(s) in 4m 11s     

@pickfire
Copy link
Contributor Author

pickfire commented Oct 29, 2018

@xftroxgpx Yup, I am already planning to do those after this commit is merge. Still waiting for the pull request to be merged. And maybe reformat the project and reorganize some tests as well.

@svenstaro
Copy link

Can we get this merged? Without it, rustup doesn't build on modern systems.

@nrc nrc merged commit c637d44 into rust-lang:master Nov 4, 2018
@nrc
Copy link
Member

nrc commented Nov 4, 2018

Thanks for the PR, sorry for the delay in merging.

Please note though that Rustup reviewers do not have much available bandwidth right not, so if anyone is keen on implementing more, please check that someone will be able to review it. (More info at https://internals.rust-lang.org/t/cargo-and-rustup-development)

@svenstaro
Copy link

@nrc I understand that you guys don't have a lot of time right now but could you make a release with this fix? It's quite important because more and more distros will start offering OpenSSL 1.1 by default and then it just won't build.

@nrc
Copy link
Member

nrc commented Nov 5, 2018

I understand that you guys don't have a lot of time right now but could you make a release with this fix?

I'm planning to make a Rustup release in a couple of weeks time. I hope that is soon enough (because we don't have release trains, rustup releases are a fair bit of work and are somewhat risky).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't compile: Unable to detect OpenSSL version
4 participants