Hello! I use Win10 x64 pro and last rust nightly. I would like to use Rocket version 3.15. My Cargo.toml:
[package]
name = "sci_questionnaire"
version = "0.1.0"
authors = ["袗薪褌芯薪 小懈薪懈褑褘薪 <[email protected]>"]
[dependencies]
rocket = { git = "https://github.com/SergioBenitez/Rocket" }
rocket_codegen = { version = "0.3.15", git = "https://github.com/SergioBenitez/Rocket" }
serde = "*"
serde_derive = "*"
serde_json = "*"
sqlite = "*"
[dependencies.rocket_contrib]
version = "0.3.*"
default-features = false
features = ["handlebars_templates"]
And i have build error:
cargo build --all-features
Updating git repository `https://github.com/SergioBenitez/Rocket`
Updating registry `https://github.com/rust-lang/crates.io-index`
error: no matching package named `rocket_codegen` found
location searched: https://github.com/SergioBenitez/Rocket
did you mean: rocket_codegen
required by package `sci_questionnaire v0.1.0 (file:///C:/sci_questionnaire)`
My project placed: https://github.com/sinitcin/sci_questionnaire/blob/master/Cargo.toml
Why my Cargo.toml is incorrect? Thank you in advance.
Combining git = with version = doesn't usually do what you want. If your goal is to use 0.3.15, rocket = "0.3.15" and rocket_codegen = "0.3.15" are sufficient.
But, i have the ring build problem like issue #642 And i use recommendation from this comment - https://github.com/SergioBenitez/Rocket/issues/642#issuecomment-395895257 .
If i not use version i have build error. When I get home I'll write the text of the build errors I get on Win10
Oh right, #642 -- unfortunately you cannot use Rocket 0.3.15 on Windows for that reason. If you are having problems using git = alone, we would be happy to help debug those.
Okay, i delete "version" from Cargo.toml:
[package]
name = "sci_questionnaire"
version = "0.1.0"
authors = ["袗薪褌芯薪 小懈薪懈褑褘薪 <[email protected]>"]
[dependencies]
rocket = { git = "https://github.com/SergioBenitez/Rocket" }
rocket_codegen = { git = "https://github.com/SergioBenitez/Rocket" }
serde = "*"
serde_derive = "*"
serde_json = "*"
sqlite = "*"
[dependencies.rocket_contrib]
default-features = false
features = ["handlebars_templates"]
And i have new build error:
PS C:\sci_questionnaire> cargo clean
PS C:\sci_questionnaire>cargo build
warning: dependency (rocket_contrib) specified without providing a local path, Git repository, or version to use. This will be considered an error in future versions
error: multiple packages link to native library `ring-asm`, but a native library can be linked only once
package `ring v0.13.2`
... which is depended on by `cookie v0.11.0`
... which is depended on by `rocket_http v0.4.0-dev (https://github.com/SergioBenitez/Rocket#fd6d5771)`
... which is depended on by `rocket v0.4.0-dev (https://github.com/SergioBenitez/Rocket#fd6d5771)`
... which is depended on by `sci_questionnaire v0.1.0 (file:///C:/sci_questionnaire)`
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.15`
... which is depended on by `rocket_contrib v0.3.15`
... which is depended on by `sci_questionnaire v0.1.0 (file:///C:/sci_questionnaire)`
also links to native library `ring-asm`
Please help me for fix this =(
The first warning says you need to specify a version (or git, or path) for rocket_contrib -- you don't have a git = line for that one.
The rest of the error should be resolved as well once you fix that.
Sorry, not resolved. Project placed on https://github.com/sinitcin/sci_questionnaire you can clone if this need. New build problem:
cargo build
Updating git repository `https://github.com/SergioBenitez/Rocket`
Updating registry `https://github.com/rust-lang/crates.io-index`
Compiling proc-macro2 v0.4.13
Compiling unicode-xid v0.1.0
Compiling version_check v0.1.4
Compiling matches v0.1.7
Compiling yansi v0.4.0
Compiling cfg-if v0.1.5
Compiling winapi v0.3.5
Compiling cc v1.0.18
Compiling httparse v1.3.2
Compiling unicode-normalization v0.1.7
Compiling untrusted v0.6.2
Compiling void v1.0.2
Compiling libc v0.2.43
Compiling byteorder v1.2.4
Compiling safemem v0.2.0
Compiling bitflags v1.0.3
Compiling percent-encoding v1.0.1
Compiling serde v1.0.71
Compiling unicode-xid v0.0.4
Compiling typeable v0.1.2
Compiling winapi-build v0.1.1
Compiling language-tags v0.2.2
Compiling ryu v0.2.4
Compiling traitobject v0.1.0
Compiling pkg-config v0.3.13
Compiling state v0.4.1
Compiling regex v1.0.2
Compiling indexmap v1.0.1
Compiling ucd-util v0.1.1
Compiling quote v0.3.15
Compiling utf8-ranges v1.0.0
Compiling winapi v0.2.8
Compiling itoa v0.4.2
Compiling pest v1.0.6
Compiling bitflags v0.7.0
Compiling quick-error v1.2.2
Compiling glob v0.2.11
Compiling unicode-bidi v0.3.4
Compiling log v0.4.4
Compiling filetime v0.1.15
Compiling unicase v1.4.2
Compiling lazy_static v1.1.0
Compiling pear_codegen v0.1.0 (http://github.com/SergioBenitez/Pear?rev=b475140#b4751403)
Compiling rocket v0.4.0-dev (https://github.com/SergioBenitez/Rocket#fd6d5771)
Compiling rocket_codegen v0.4.0-dev (https://github.com/SergioBenitez/Rocket#fd6d5771)
Compiling unreachable v1.0.0
Compiling ring v0.13.2
Compiling num_cpus v1.8.0
Compiling memchr v2.0.1
Compiling base64 v0.9.2
Compiling base64 v0.6.0
Compiling synom v0.11.3
Compiling kernel32-sys v0.2.2
Compiling sqlite3-src v0.2.10
Compiling regex-syntax v0.6.2
Compiling log v0.3.9
Compiling smallvec v0.6.4
Compiling aho-corasick v0.6.6
Compiling syn v0.11.11
Compiling mime v0.2.6
Compiling quote v0.6.6
Compiling time v0.1.40
Compiling same-file v1.0.2
Compiling isatty v0.1.8
Compiling pest_derive v1.0.8
Compiling idna v0.1.5
Compiling syn v0.14.8
Compiling toml v0.4.6
Compiling serde_json v1.0.26
Compiling thread_local v0.3.6
Compiling walkdir v2.2.0
Compiling sqlite3-sys v0.12.0
Compiling url v1.7.1
Compiling sqlite v0.23.9
Compiling notify v4.0.4
Compiling hyper v0.10.13
Compiling cookie v0.11.0
Compiling derive_utils_core v0.1.0 (https://github.com/SergioBenitez/derive-utils?rev=160da392#160da392)
Compiling serde_derive v1.0.71
Compiling handlebars v1.0.1
Compiling pear v0.1.0 (http://github.com/SergioBenitez/Pear?rev=b475140#b4751403)
Compiling rocket_http v0.4.0-dev (https://github.com/SergioBenitez/Rocket#fd6d5771)
Compiling derive_utils_codegen v0.1.0 (https://github.com/SergioBenitez/derive-utils?rev=160da392#160da392)
Compiling derive_utils v0.1.0 (https://github.com/SergioBenitez/derive-utils?rev=160da392#160da392)
Compiling rocket_codegen_next v0.4.0-dev (https://github.com/SergioBenitez/Rocket#fd6d5771)
Compiling rocket_contrib v0.4.0-dev (https://github.com/SergioBenitez/Rocket#fd6d5771)
Compiling sci_questionnaire v0.1.0 (file:///C:/sci_questionnaire)
error: cannot find derive macro `FromForm` in this scope
--> src\main.rs:66:17
|
66 | #[derive(Debug, FromForm)]
| ^^^^^^^^
error: aborting due to previous error
error: Could not compile `sci_questionnaire`.
To learn more, run the command again with --verbose.
The master branch of Rocket has made some changes to its macros and derives that work towards less breakage from rust nightly in the future. One of the side effects is that #[macro_use] is now necessary on the extern crate rocket; line.
Hallelujah =) It work. Do you think about update of examples for better quality of code? I do not know English well and it is easier for me to understand the code than the manual. The solution to this problem was not obvious to me, unfortunately. Perhaps, in the future it would be worth correcting Cargo.toml in order to avoid problems with the build ring and rocket_contrib on Win10?
And big thank you =)
When Rocket 0.4 is released soon it will "just work", and examples and documentation will be updated. Unfortunately, Rocket 0.3 cannot be fixed in this way without breaking other existing Rocket applications.
It sounds like this issue is resolved for now, so I'll close it out.
Rocket 0.3 cannot be fixed in this way without breaking other existing Rocket applications.
Is there an UPGRADING file @jebrosen?
@jens1o I'm not sure what you mean. Who or what project would provide this UPGRADING file and what information should be in it?
Changing ring from 0.11 to 0.13 is a semver breaking change due to the way ring currently works, so this upgrade will not happen until Rocket also changes its version number from 0.3 to 0.4.
Rocket also changes its version number from 0.3 to 0.4
You said that there will be breaking changes. I wonder whether I can prepare something for the next release to adapt it as fast as possible?
@jebrosen i understand and thank you!
@jens1o We will have notes on how to upgrade once the release is cut.