#162·paperclip

[Suggestion] Actix Plugin: Support a range of actix_web versions

Author: dhorkinCreated Mar 6, 2020Updated Jul 25, 2025
Labelsenhancementnormal

This merged PR broke the ability to compile paperclip for me: https://github.com/wafflespeanut/paperclip/pull/154

The problem is we're using an older version of actix_web (1.0.9) and you're using 2.0.0 now.

According to your documentation,

While it's not feature complete, you can rely on it to not break your actix-web flow.

Unfortunately, it won't compile with two versions of actix-web, and thus this is breaking my actix-web flow:

#14 349.5 error[E0308]: mismatched types #14 349.5 --> api/src/faux_filename1.rs:44:9 #14 349.5 | #14 349.5 44 | async_response() #14 349.5 | ^^^^^^^^^^^^^^^^ expected struct actix_http::response::Response, found a different struct actix_http::response::Response #14 349.5 | #14 349.5 ::: api/src/faux_filename1.rs:252:76 #14 349.5 | #14 349.5 252 | pub fn create_async(state: SyncData, path: Path, payload: String) -> Result { #14 349.5 | -------------------- expected std::result::Result<actix_http::response::Response, actix_http::error::Error> because of return type #14 349.5 253 | let id = *path; #14 349.5 254 | do_async!(state, id, path, &payload, &create, CreateParams) #14 349.5 | ---------------------------------------------------------------- in this macro invocation #14 349.5 | #14 349.5 = note: expected enum std::result::Result<actix_http::response::Response, _> (struct actix_http::response::Response) #14 349.5 found enum std::result::Result<actix_http::response::Response, _> (struct actix_http::response::Response) #14 349.5 = note: perhaps two different versions of crate actix_http are being used?

And I can't override it:

$ cargo update --package actix-web:2.0.0 --precise 1.0.9 Updating crates.io index error: failed to select a version for the requirement actix-web = "^2.0" candidate versions found which didn't match: 1.0.9 location searched: crates.io index required by package paperclip-actix v0.1.0 (https://github.com/wafflespeanut/paperclip.git#093ed30b) ... which is depended on by paperclip v0.3.0 (https://github.com/wafflespeanut/paperclip.git#093ed30b) ... which is depended on by api v0.5.1 (/Users/FFdhorkin/repo/.....) ... which is depended on by app v0.5.1 (/Users/FFdhorkin/repo/.....)

I have a local copy of paperclip that reverts the above merge (but is otherwise up to date with your latest), and that's allowing me to continue making some progress getting this working, but it doesn't seem like a great long-term option. I have tried getting our codebase working with actix_web 2.0.0, but that looks like it's going to be its own can of worms.

I don't know enough about what paperclip is doing behind the scenes to know how tightly tied it is to a particular version of actix_web, but it would be nice if it could somehow wrap the interface of actix_web without requiring the package to be a specific version (with the understanding some versions might not compile)