Skip to content

Update tokio-core uses to tokio-0.1#304

Merged
luser merged 2 commits intomozilla:masterfrom
Marwes:tokio_upgrade
Nov 23, 2018
Merged

Update tokio-core uses to tokio-0.1#304
luser merged 2 commits intomozilla:masterfrom
Marwes:tokio_upgrade

Conversation

@Marwes
Copy link
Copy Markdown
Contributor

@Marwes Marwes commented Oct 9, 2018

reqwest has received an update to drop its tokio-core dependency so it is now possible to move to using tokio here as well.

hyperx were pulled it to paper over hyper's removal of typed headers but were otherwise avoided.

Since there are quite a few non-Send futures I had to use current_thread::Runtime instead of the standard multi-threaded runtime.

@Marwes Marwes changed the title Update toki-core uses to tokio-0.1 Update tokio-core uses to tokio-0.1 Oct 9, 2018
@luser
Copy link
Copy Markdown
Contributor

luser commented Oct 9, 2018

I'm probably missing some bit of information, but what's the motivation behind these changes?

@Marwes
Copy link
Copy Markdown
Contributor Author

Marwes commented Oct 9, 2018

Just a follow up of #286. tokio-core is deprecated with tokio as the replacement.

let server = listener.incoming().for_each(move |(socket, _addr)| {
let server = listener.incoming().for_each(move |socket| {
trace!("incoming connection");
SccacheProto.bind_server(&handle, socket, service.clone());
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Forgot I need to cleanup this part. tokio-proto is unmaintained so I had to string together a minimal version of it instead but it still uses some of tokio-proto's types which makes it a bit of a mess.

https://github.com/tokio-rs/tokio-proto.

@Marwes Marwes force-pushed the tokio_upgrade branch 3 times, most recently from b02a522 to f10d3c5 Compare October 13, 2018 08:14
@Marwes
Copy link
Copy Markdown
Contributor Author

Marwes commented Oct 13, 2018

Marwes@0faa567 might be a bit more palatable, it is on this branch https://github.com/Marwes/sccache/commits/fmt_plus_tokio which formats the entire project first so that any accidental formatting changes are in a separate commit, and all the behavioural changes are in the second commit.

@Marwes Marwes force-pushed the tokio_upgrade branch 2 times, most recently from 519718e to 6d748f6 Compare October 15, 2018 11:35
@Marwes
Copy link
Copy Markdown
Contributor Author

Marwes commented Oct 15, 2018

Seeing a deprecation warning about length_delimited but fixing is blocked on https://github.com/antoyo/tokio-serde-bincode/issues/1

warning: use of deprecated item 'tokio_io::codec::length_delimited::Framed': Moved to tokio-codec                                                                                                           
  --> src/server.rs:57:5                                                                                                                                                                                    
   |                                                                                                                                                                                                        
57 | use tokio_io::codec::length_delimited::Framed;                                                                                                                                                         
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                          
   |                                                                                                                                                                                                        
   = note: #[warn(deprecated)] on by default                                                                                                                                                                
                                                                                                                                                                                                            
warning: use of deprecated item 'tokio_io::codec::length_delimited::Framed': Moved to tokio-codec                                                                                                           
   --> src/server.rs:969:37                                                                                                                                                                                 
    |                                                                                                                                                                                                       
969 |     inner: WriteBincode<ReadBincode<Framed<I>, Request>, Response>,                                                                                                                                   
    |                                     ^^^^^^^^^                                                                                                                                                         
                                                                                                                                                                                                            
warning: use of deprecated item 'tokio_io::codec::length_delimited::Framed': Moved to tokio-codec                                                                                                           
   --> src/server.rs:475:55                                                                                                                                                                                 
    |                                                                                                                                                                                                       
475 |             inner: WriteBincode::new(ReadBincode::new(Framed::new(socket))),          
    |                                                       ^^^^^^^^^^^
                                                                                       
warning: use of deprecated item 'tokio_io::codec::length_delimited::Framed': Moved to tokio-codec
  --> src/server.rs:57:5                                            
   |                                                                        
57 | use tokio_io::codec::length_delimited::Framed;                                              
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |                                                                   
   = note: #[warn(deprecated)] on by default                             
                                                                           
warning: use of deprecated item 'tokio_io::codec::length_delimited::Framed': Moved to tokio-codec
   --> src/server.rs:969:37                                                                      
    |                                                           
969 |     inner: WriteBincode<ReadBincode<Framed<I>, Request>, Response>,
    |                                     ^^^^^^^^^                               
                                                                         
warning: use of deprecated item 'tokio_io::codec::length_delimited::Framed': Moved to tokio-codec
   --> src/server.rs:475:55                                                                      
    |                                                            
475 |             inner: WriteBincode::new(ReadBincode::new(Framed::new(socket))),
    |                                                       ^^^^^^^^^^^
                                                                   

@luser
Copy link
Copy Markdown
Contributor

luser commented Oct 23, 2018

Thanks for the PR! I think this will need to wait until we land the last few sccache-dist PRs. #323 should be the second-to-last one.

@joshuawarner32
Copy link
Copy Markdown

Hi! I think I've been running into #248 (which might be fixed by this) - any updates on getting this landed?

@luser
Copy link
Copy Markdown
Contributor

luser commented Nov 12, 2018

We're very close to finishing landing all the distributed compilation work--I'll get this landed as soon as that's all done.

@Marwes Marwes force-pushed the tokio_upgrade branch 2 times, most recently from 1990a52 to 3b8c700 Compare November 20, 2018 16:04
@luser
Copy link
Copy Markdown
Contributor

luser commented Nov 21, 2018

OK, I apologize for how long this has taken, but if you want to rebase this one last time I will merge it immediately.

@Marwes
Copy link
Copy Markdown
Contributor Author

Marwes commented Nov 23, 2018

Rebased but seem to have broken something in the distributed compilation. Will try and debug it.

Also updates request to 0.9 (as that uses hyper 0.12)
@luser luser merged commit 06651d4 into mozilla:master Nov 23, 2018
@luser
Copy link
Copy Markdown
Contributor

luser commented Nov 23, 2018

Thanks! Sorry that this took so long to merge that you had to rebase it several times.

@Marwes Marwes deleted the tokio_upgrade branch November 26, 2018 09:23
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.

3 participants