-
Notifications
You must be signed in to change notification settings - Fork 31
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
How to keep only last build's artifacts without having to rebuild everything? #9
Comments
Currently you will have to use the stamp and file loading features outlined in the README. |
A full rebuild takes hours for my project, so I want to avoid that.. |
Well, cargo sweep -s will not clean anything, just generate a timestamp. If you have not cleaned your project already (with cargo clean) cargo build will go very quickly, but is needed so that access times are updated. Since all used artifacts now will have a newer access times than the one in the timestamp file, cargo sweep -f will clean the unused ones. Unfortunately cargo does not yet output the needed information to allow for a single cargo-sweep pass without intermediate step, but this will be added as soon as the build-plan flag is stabilized, see #2 |
Thanks, I did this now, and it worked. Unfortunately it also deleted all my frontend artifacts, requiring me to rebuild the whole yew/wasm frontend including its deps (with |
Ah that is not very good, and might be a bug with multiple crates in the same workspace. |
At first, I only built the backend between -s and -f but now I wanted to try it again with building both in between. BUT: Now it builds all the deps of my backend from scratch, as if they were deleted or dirty, that shouldn't happen! It should reuse the artifacts from the last build, since nothing changed and |
Okay, that is very strange. Is your project open source by any chance? In that case I could try and take a look specifically on your project and try to find the problem. Will hopefully have time to look at this this weekend and integrate it as part of 0.3.0 if it is indeed a bug. |
@holmgr Unfortunately it's closed source. I'm building the backend on Win 8.1 x64 with rustc-msvc and the frontend for wasm32-unknown-unknown. Btw, now this build of the backend failed with hundreds of errors like this:
for different files, and then ends with:
:( What should I do now? |
Ah very bad then... :( |
Might be related to rust-lang/rust#48700, tagging this so I can personally keep track of it in this issue |
Is it really a rustc bug? I thought it's because cargo-sweep deleted some files that were still needed for incremental builds.. (I never had "occasional panics" from rustc before, especially not about missing files.) |
Probably not, but the issue might be that cleaning the incremental folder is not really a safe thing to do. Currently the tool is agnostic about the types of files/folders in target. Which might not be safe even if I have tested it with about a dousin projects. Again, sorry for any problems I may have caused :( |
Maybe it's because the artifacts from incremental builds aren't touched between -s and -f even when they are still needed? |
Yes exactly. So for now I might just try and ignore the experimental subfolder |
But at the same time that would mean that those files were not read when building, but at the same time they are needed when building. Perhaps cargo just checks if they are available but not reading, thus not updating access times. This might be related to #3, but since it does not "crash" it seems unlikely |
@holmgr Cargo tries to delete a lot of them at least (the many warnings), but it tried to read at least one (the error/panic). |
How to keep only the last build's artifacts without having to rebuild everything?
The text was updated successfully, but these errors were encountered: