Comments (17)
The crate does not depend specifically on Rocket 0.3.3 -- in fact I do not even have a Cargo.lock
checked in as per usual library practices. It depends on all 0.3.x
.
Anyway neither this crate nor Rocket depend on ring
directly. You can add these lines to your Cargo.toml
to use the same workaround as Rocket does.
from rocket_cors.
The problem is, this crate depends on rocket 0.3 but rocket master is 0.4.0-dev, so I get this error:
error: Multiple packages link to native library `ring-asm`. A native library can be linked only once.
Package `ring v0.11.0`
... which is depended on by `cookie v0.9.1`
... which is depended on by `rocket v0.3.5`
... which is depended on by `rocket_cors v0.2.1`
... which is depended on by `webserver v0.1.0 (file:///D:/docs/foo/foo-server/server)`
... which is depended on by `foo-server v0.1.0 (file:///D:/docs/foo/foo-server)`
links to native library `ring-asm`.
Package `ring v0.12.1`
... which is depended on by `cookie v0.11.0-dev (https://github.com/alexcrichton/cookie-rs?rev=a15b37a#a15b37af)`
... which is depended on by `webserver v0.1.0 (file:///D:/docs/foo/foo-server/server)`
... which is depended on by `foo-server v0.1.0 (file:///D:/docs/foo/foo-server)`
also links to native library `ring-asm`.
How can I fix this? :)
from rocket_cors.
I bumped up the rocket version in a fork for now: https://github.com/Boscop/rocket_cors
from rocket_cors.
Another way to fix this is to simply replace the Rocket dependency to point to Rocket's master branch in your own crate:
[patch.crates-io]
rocket = { git = "https://github.com/SergioBenitez/Rocket", version = "0.4.0-dev" }
I don't intend to update the master branch to point to an unreleased version of Rocket at the moment.
from rocket_cors.
I don't intend to update the master branch to point to an unreleased version of Rocket at the moment.
I didn't mean to suggest you to do that..
But I like the patch solution more, I tried to do it:
[patch.crates-io]
ring = { git = "https://github.com/SergioBenitez/ring", branch = "v0.12" }
rocket = { git = "https://github.com/SergioBenitez/Rocket", version = "0.4.0-dev" }
(the ring patch was from before, to make it work)
But now I get the same error again:
error: multiple packages link to native library `ring-asm`, but a native library can be linked only once
package `ring v0.12.2 (https://github.com/SergioBenitez/ring?branch=v0.12#9ccfa153)`
... which is depended on by `cookie v0.11.0-dev (https://github.com/alexcrichton/cookie-rs?rev=a15b37a#a15b37af)`
... which is depended on by `rocket v0.4.0-dev (https://github.com/SergioBenitez/Rocket#9bf33bdd)`
... which is depended on by `rocket_contrib v0.4.0-dev (https://github.com/SergioBenitez/Rocket#9bf33bdd)`
... which is depended on by `webserver v0.1.0 (file:///D:/docs/foo/foo-server/server)`
... which is depended on by `foo-server v0.1.0 (file:///D:/docs/foo/foo-server)`
links to native library `ring-asm`
package `ring v0.11.0`
... which is depended on by `cookie v0.9.2`
... which is depended on by `rocket v0.3.5`
... which is depended on by `rocket_cors v0.2.1`
... which is depended on by `webserver v0.1.0 (file:///D:/docs/foo/foo-server/server)`
... which is depended on by `foo-server v0.1.0 (file:///D:/docs/foo/foo-server)`
also links to native library `ring-asm`
Why does it use the ring patch but not the one for rocket?
Btw, in the rest of my Cargo.toml I have:
rocket = { git = "https://github.com/SergioBenitez/Rocket", version = "0.4.0-dev" }
rocket_codegen = { git = "https://github.com/SergioBenitez/Rocket", version = "0.4.0-dev" }
rocket_contrib = { git = "https://github.com/SergioBenitez/Rocket", version = "0.4.0-dev" }
from rocket_cors.
Looks like you need to do the same for Cookie. Might just be better off using your forked version if you have to do this for every other dependency.
from rocket_cors.
But how to do this for cookie? Am I not doing it globally for ALL crates that depend on rocket?
from rocket_cors.
11:04 <Sergio> You can only patch within semver compatible versions
Seems like there is no way to patch it, so I have to keep using my fork..
from rocket_cors.
from rocket_cors.
@Boscop There is a PR in ring
that will hopefully prevent this issue in the future.
I'll keep this open to keep an eye on that PR and I'll update accordingly when rocket
also upgrades.
from rocket_cors.
Rocket 0.4 now requires ring 0.13.
from rocket_cors.
My Cargo.toml
[package]
name = "rocket2"
version = "0.1.0"
authors = ["incker"]
edition = "2018"
[dependencies]
rocket = "0.4.0-rc.2"
[dependencies.rocket_contrib]
version = "*"
default-features = false
features = ["handlebars_templates", "tera_templates"]
Error that I see:
error: multiple packages link to native library `ring-asm`, but a native library can be linked only once
package `ring v0.13.5`
... which is depended on by `cookie v0.11.0`
... which is depended on by `rocket_http v0.4.0-rc.2`
... which is depended on by `rocket v0.4.0-rc.2`
... which is depended on by `rocket2 v0.1.0 (C:\rust\rocket2)`
links to native library `ring-asm`
package `ring v0.11.0`
... which is depended on by `cookie v0.9.2`
... which is depended on by `rocket v0.3.17`
... which is depended on by `rocket_contrib v0.3.17`
... which is depended on by `rocket2 v0.1.0 (C:\rust\rocket2)`
also links to native library `ring-asm`
What I did wrong?
from rocket_cors.
@incker: I haven't updated the crate to support Rocket 0.4.0.rc.2
.
Fixed in #53.
New release: https://github.com/lawliet89/rocket_cors/releases/tag/v0.4.0-rc.3
from rocket_cors.
@incker: I haven't updated the crate to support Rocket
0.4.0.rc.2
.Fixed in #53.
New release: https://github.com/lawliet89/rocket_cors/releases/tag/v0.4.0-rc.3
I am not sure, what exactly have helped me, but this code works for me:
[package]
name = "rocket2"
version = "0.1.0"
authors = ["incker"]
edition = "2018"
[dependencies]
rocket = "0.4.0-rc.2"
rocket_cors = { git = "https://github.com/lawliet89/rocket_cors", branch = "master" }
[dependencies.rocket_contrib]
version = "0.4.0-rc.2"
default-features = false
features = ["handlebars_templates", "tera_templates"]
maybe version of dependencies.rocket_contrib
was also needed
Thank you
from rocket_cors.
Maybe it is already not that topic to write,
but now I have same problem when I added line rocket_static_fs = "*"
to Cargo.toml
from rocket_cors.
rocket_cors = "0.4.0-rc.3"
would be sufficient.
Like the earlier comments in the issue, anything that depends directly or transitively on ring
needs to be on the same version. There's not much I can do about it for you.
from rocket_cors.
I am closing this issue for now. The version of Ring supported by this crate will track that of Rocket's.
from rocket_cors.
Related Issues (20)
- Building on `stable` results in error HOT 5
- Rocket Cors & Headers HOT 1
- Fairing CORS fails preflight check HOT 1
- Build error with latest async-trait HOT 3
- No CORS headers (even running example) HOT 1
- Build error on Rust 1.33.0-nightly. HOT 2
- Upload Documentation to Github Pages using Github Actions HOT 6
- Add a builder pattern to CorsOptions HOT 2
- Hide Error: No matching routes for OPTIONS HOT 3
- `log` is ambiguous HOT 7
- Fairing working in local but not in remote server HOT 1
- Support for Rocket async branch HOT 4
- Cors Partially working HOT 4
- Support configuration from Rocket.toml HOT 2
- Define MSRV when Rocket 0.5 is released HOT 1
- Switch back Rocket dependency to crates.io when 0.5 is released HOT 5
- CORS gives an error when booting with the default settings and accessing with axios. HOT 2
- Compile on stable rust HOT 1
- Fixed Manuel Issue HOT 1
- the trait `Fairing` is not implemented for `Cors` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rocket_cors.