Closed incker closed 4 years ago
Everything works, but my compilation time while developing have risen from seconds to 4m 23s
4m 23s on each compilation? That is definitely surprising, and not something I have experienced when using git
dependencies. Generally, that long build time should happen approximately once each for check, build(debug), build(release), and test configurations.
If you haven't done it already, a single cargo clean
+ rebuild will clear the cached compiled artifacts in target/
, which might prevent the problem from reoccurring.
Thank you for your reply.
I have made a docker container with pure rocket. And it has compilation time 50 seconds on every change.
https://github.com/incker/rocket_long_compile_example
50 seconds is not 4m 23s but I think it is any way a lot, because here are only 30 lines of code. Maybe error exactly in rust nightly, but I am even not sure what and where to bug report
Thank you for any help
I had a similar problem once, and it was resolved by removing sccache
. Is there any chance you are using sccache
?
Looks like error in rust nightly. Not sure how to solve it for now, but it is not rocket problem.
I will close this issue
That sounds pretty frustrating, even 50 seconds is quite a long time to wait for re-compilation.
I took a quick look at the Dockerfile in the example you provided and noticed it's not using any layers. So part of the reason for your long compile times might be due to a lack of caching in the Docker environment.
I've been using this Dockerfile for my development environment in a couple of projects using Rocket and seeing compile times below 20 seconds pretty consistently.
Take a look if you have some time.
Thank you! Looks like it can help)
@cbzehner You see, I have in docker-compose.yml
such line: cargo watch -w ./src/ --poll -x run
I mean that I am not waiting rebuild docker on every change: Docker starts once, but cargo watch just making rebuilds every time I save (press Ctrl + S
)
I think using cargo watch -x run
or cargo watch -x test
is better solution for developing than try to speed up docker
P.S. For now I fixed that just installing ubuntu without using docker) Heh) Now my rebuild time is 8 seconds after previous 4.30 minutes. I am not sure where problem is. Maybe I have broken a little some windows virtualizing somewhere
Hello.
I was using
rocket 0.4
until now. But I have some problems with dependency namedring
or something like that, when i tried to install new versions oftokio
ortgbot
So, I decided to move to
rocket 0.5
and I modified myCargo.toml
Code:Everything works, but my compilation time while developing have risen from seconds to 4m 23s 😒
I am not sure where exactly the problem is, the target folder is still 3 Gb as like in
rocket 0.4
If you will not see problem on the surface - I would like make some more experimentsMaybe because I use dependency from git but not from crates? maybe it have sense to publish
rocket 0.5 alpha
to crates io?