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

Upgrading deps, running clippy fix on nightly 1.55.0 #1638

Merged
merged 10 commits into from
Jul 6, 2021
Merged

Conversation

dessalines
Copy link
Member

No description provided.

@dessalines dessalines requested a review from Nutomic June 23, 2021 18:09
@Nutomic
Copy link
Member

Nutomic commented Jun 24, 2021

CI timed out on federation tests, I restarted it.

@dessalines
Copy link
Member Author

@asonix I might need your help with this one, as upgrading your background_jobs library to 0.9.0 seems to crash the server now with the new actix and tokio versions. The crash happens when running background_jobs_actix::create_server which is necessary for the activitypub messages.

thread 'main' panicked at 'Arbiter is not running.', /home/xxx/.cargo/registry/src/github.com-1ecc6299db9ec823/actix-rt-2.2.0/src/arbiter.rs:187:21          [15/4815]
stack backtrace:                                                                                                                                                        
h   0: std::panicking::begin_panic                                                                                                                                      
   1: actix_rt::arbiter::Arbiter::current::{{closure}}                                                                                                                  
   2: std::thread::local::LocalKey<T>::try_with                                                                                                                         
   3: std::thread::local::LocalKey<T>::with                                                                                                                             
   4: actix_rt::arbiter::Arbiter::current                                                                                                                               
   5: background_jobs_actix::create_server                                                                                                                              
   6: lemmy_apub::activity_queue::create_activity_queue                                                                                                                 
   7: lemmy_server::main::{{closure}}                                                                                                                                   
   8: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll                                                                                
   9: <tokio::task::local::RunUntil<T> as core::future::future::Future>::poll::{{closure}}::{{closure}}                                                                 
  10: tokio::coop::with_budget::{{closure}}                                                                                                                             
  11: std::thread::local::LocalKey<T>::try_with                                                                                                                         
  12: std::thread::local::LocalKey<T>::with                                                                                                                             
  13: <tokio::task::local::RunUntil<T> as core::future::future::Future>::poll::{{closure}}                                                                              
  14: tokio::macros::scoped_tls::ScopedKey<T>::set                                                                                        
  15: tokio::task::local::LocalSet::with                                                                                                  
  16: <tokio::task::local::RunUntil<T> as core::future::future::Future>::poll                                                             
  17: tokio::task::local::LocalSet::run_until::{{closure}}                                                                                
  18: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll                                                  
  19: tokio::runtime::basic_scheduler::BasicScheduler<P>::block_on::{{closure}}::{{closure}}                                              
  20: tokio::coop::with_budget::{{closure}}                                                                                               
  21: std::thread::local::LocalKey<T>::try_with                                                                                           
  22: std::thread::local::LocalKey<T>::with                                                                                               
  23: tokio::runtime::basic_scheduler::BasicScheduler<P>::block_on::{{closure}}                                                           
  24: tokio::runtime::basic_scheduler::enter::{{closure}}         
  25: tokio::macros::scoped_tls::ScopedKey<T>::set                
  26: tokio::runtime::basic_scheduler::enter                                                                                              
  27: tokio::runtime::basic_scheduler::BasicScheduler<P>::block_on
  28: tokio::runtime::Runtime::block_on::{{closure}}
  29: tokio::runtime::context::enter                                                
  30: tokio::runtime::handle::Handle::enter                                         
  31: tokio::runtime::Runtime::block_on                                             
  32: tokio::task::local::LocalSet::block_on                                        
  33: actix_rt::runtime::Runtime::block_on                                          
  34: actix_rt::builder::SystemRunner::block_on                                     
  35: lemmy_server::main                  
  36: core::ops::function::FnOnce::call_once                                        
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.                                                                                 
Panic in Arbiter thread. 

@asonix
Copy link
Collaborator

asonix commented Jun 24, 2021

you can't upgraded to 0.9.0 without upgrading actix-web to the 4.0 betas. go back to the older version

@asonix
Copy link
Collaborator

asonix commented Jun 24, 2021

oh wait, you did... i'll take a look

@asonix
Copy link
Collaborator

asonix commented Jun 24, 2021

wait a sec, you upgraded tokio & actix-rt, but you didn't upgrade actix or actix-web, and you're using actix_web::main to start your runtime, which still starts an actix-rt 1 runtime

you gotta do a full upgrade or not at all

@dessalines
Copy link
Member Author

Thx, I'll try this.

@dessalines dessalines changed the base branch from main to clippy_fix_1 July 4, 2021 23:21
@dessalines
Copy link
Member Author

@asonix , another issue, with the newest version of http-signature-normalization-actix:

https://github.com/lemmynet/lemmy/blob/upgrade_deps_4/crates/apub_receive/src/routes.rs#L78

error[E0277]: the trait bound `VerifyDigest<Sha256>: Transform<actix_web::scope::ScopeService, ServiceRequest>` is not satisfied
  --> crates/apub_receive/src/routes.rs:78:17
   |
78 |           .wrap(digest_verifier)
   |                 ^^^^^^^^^^^^^^^ the trait `Transform<actix_web::scope::ScopeService, ServiceRequest>` is not implemented for `VerifyDi
gest<Sha256>`

@asonix
Copy link
Collaborator

asonix commented Jul 5, 2021

@dessalines update http-signature-normalization-actix to 0.5.0-beta.6

@dessalines dessalines changed the base branch from clippy_fix_1 to main July 5, 2021 22:30
info: web::Query<Params>,
context: web::Data<LemmyContext>,
) -> Result<HttpResponse, Error> {
let sort_type = get_sort_type(info).map_err(ErrorBadRequest)?;

let req_type: String = req.match_info().get("type").unwrap().parse().unwrap();
let param: String = req.match_info().get("name").unwrap().parse().unwrap();
Copy link
Member

Choose a reason for hiding this comment

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

Please handle this without unwrap.

Copy link
Member Author

Choose a reason for hiding this comment

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

K got it.

@dessalines dessalines requested a review from Nutomic July 6, 2021 00:05
info: web::Query<Params>,
context: web::Data<LemmyContext>,
) -> Result<HttpResponse, Error> {
let sort_type = get_sort_type(info).map_err(ErrorBadRequest)?;

let req_type: String = req.match_info().get("type").unwrap_or("none").parse()?;
let param: String = req.match_info().get("name").unwrap_or("none").parse()?;
Copy link
Member

@Nutomic Nutomic Jul 6, 2021

Choose a reason for hiding this comment

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

Hmm that seems pretty much the same as before. Why did you remove the web::Path at all, did they remove that type?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep they removed that tuple and made it private.

Copy link
Member

Choose a reason for hiding this comment

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

Damn

@Nutomic Nutomic merged commit 9840f5c into main Jul 6, 2021
Nutomic pushed a commit that referenced this pull request Jul 30, 2021
* Upgrading deps, running clippy fix on nightly 1.55.0

* Running clippy --fix

* Trying to fix transform

* Trying to fix another transform

* Upgrading http-signature-normalization-actix

* Fix app_data

* Fix pictrs uploading

* Fix unwrap
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