-
Notifications
You must be signed in to change notification settings - Fork 63
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
Unnecessary build files left in the target
directory
#89
Comments
Interesting, but deleting a directory can also be time consuming and contributed to build time, which I think most people may notice and avoid. If the directory is too large, you can always run |
I doubt that deleting a directory will cause any large bottlenecks during compilation. I did a small benchmark where I simply run Original code:
Modified code (that removes the
The results are pretty much the same. Granted, I have an SSD disk, but even then, deleting a directory really shouldn't be a big issue in the grand scheme of Rust compilation. You can find my patched version here. Also, the build script currently does
I can, but the problem is that it removes everything. I have a bunch of projects using jemalloc, and I work on them regularly. The problem is that once I do the initial build, the |
@BusyJay So, what do you think? :) I can send a PR if you'd like. |
When
jemalloc-sys
builds the jemalloc native dependency, it first creates abuild
directory on disk, then runsmake
andmake install
, which installs a copy of the built libs into alib
directory, amongst other things. However, after the build finishes, thebuild
directory is still kept on disk. It takes ~220 MiB on my x64 Linux, which is quite a lot! Especially considering that it can exist in multiple copies (debug/release, multiple repos usingjemalloc
etc.).I think that the
build.rs
script should delete thebuild
directory from disk once the compilation (make install
) successfully finishes, since it shouldn't be needed anymore, and I don't think that Cargo will ever reuse it (if something relevant changes, Cargo will compile jemalloc from scratch in a different directory, AFAIK).What do you think?
The text was updated successfully, but these errors were encountered: