-
Notifications
You must be signed in to change notification settings - Fork 125
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
Hello example failing to build #400
Comments
Hey, how are you building it? We had re-exported |
Hello. Im just compiling with cargo. 'cargo build' There is no additional configuration in cargo.toml |
I got hit by this a couple of times when trying out some examples. |
Yup, you are not supposed to modify the |
I would think that most people (atleast this is what I do, usually) would compile and run example code and then copy paste snippets or the entire thing into a project in which they want to use the code/tool. |
If we can't run a simple code snnipet, with simple cargo confuguration, I
think we have an issue in documentation.
Em seg, 24 de fev de 2020 00:02, Kahlil Abreu <[email protected]>
escreveu:
… I would think that most people (atleast this is what I do, usually) would
compile and run example code and then copy paste snippets or the entire
thing into a project in which they want to use the code/tool.
So imo, there should be either a note or gotcha in the documentation along
with something that would guide or help people using the library to use the
example code/concept in their code. I'm willing to write this/open a PR for
this if someone can help/review/guide me 😄
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#400?email_source=notifications&email_token=ABSGNFUCBPTVLRGM63D7JV3REM2C5A5CNFSM4KR2CMYKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEMWQIVY#issuecomment-590152791>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABSGNFT4S5KNC2I2UEI5V6DREM2C5ANCNFSM4KR2CMYA>
.
|
@kahlil29 Could you post your proposed solution here? So at least in absence of documentation those (like me) searching for a solution to this are somewhat likely to find this issue and be able to use your solution. I've observed several problems in trying to copy-paste an example into my own project. The example uses something like this in the test:
The first problem is that Since Gotham appears to be re-mapping
But these both fail to compile with "E0277 can't compare http::status::StatusCode with http::status::StatusCode". Since
Any suggestions? |
@blueskyjunkie |
@kahlil29 Gotcha. It seems you have to make sure the versions of hyper and http you import into your project are exactly the same as those used by gotham itself. Presumably there's a Cargo way to do this, but in the Intellij IDEA IDE project I just looked at the "External libraries" drop down tree in the project structure to find which versions of http and hyper are imported automatically by gotham. and then made sure those versions are imported in my Definitely a documentation issue at the moment, but also comprises a maintenance issue because you have to manually track the http/hyper versions in your own project. I think the fix is for gotham to publically export it's hyper/http dependencies for transparent use by a dependent project like hyper does for it's http dependencies. |
Yes, what is the status of 0.5. There are significant differences between what the examples have and what is needed to make it work with 0.4. When can a 0.5 be expected? |
@nyarly - are you able to release a gotham 0.5.0-rc.0? Just responding here in case you don't see the chat in gitter about it. |
Version |
I'd think that the thing to do really is a documentation change - add comments to the examples themselves, or their READMEs or the README in the top level examples directory. Something to the effect that if you're going to C&P, be aware that versions are still very significant, and you'll want to work from the tag matching the version of Gotham that you're using. As I'm formulating that response, I think there's a overarching issue with a unified docs strategy. |
The example https://github.com/gotham-rs/gotham/tree/master/examples/hello_world fails to build. Seems there is a wrong module being imported, or api had changes and example wasn't updated
assert_eq!(response.status(), StatusCode::Ok);
^^^^^^^^^^ use of undeclared type or module
StatusCode
The text was updated successfully, but these errors were encountered: