-
Notifications
You must be signed in to change notification settings - Fork 12.1k
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
Rust compiler creating huge files on tmp directory #64276
Comments
Hm, so it seems like we do need a temporary directory for these files. If we can't place them in Do we know what other compilers do here? Presumably, gcc/clang etc all need to write out version scripts and such too? |
O_TMPFILE descriptors could be an option, they never pollute the directory tree unless they get linked into it. That said I would also like them to go into a separate path designated for temporary files. My project folders are under btrfs and get snapshotted via cron jobs. It is preferable if tempfiles don't make it into the snapshots. |
I believe we can't use O_TMPFILE and such as we usually need to pass paths to linkers and such that don't accept file descriptors as inputs. |
You can pass them as |
Unfortunately, that's not supported on all platforms I believe, though I could well be wrong. It's also likely to cause problem when trying to debug what went wrong since all of the files are by definition gone :) |
Hit this as well. I think any build outputs (including temporary ones) should go on the same filesystem as the final outputs, since we can expect that to be large enough. So a good strategy is to make a subdirectory under the out dir (or path of one of the outputs). |
Was surprised to get the following no space left error ...
This happens because rustc_driver is placing a lot of huge places on
/tmp
and tmp on my machine is of typetmpfs
which is stored usually in RAM or swap and it's by default half of the RAM, so 4GB in my old machine.The following are the files created ...
I think that the compilation process shouldn't place this kind of files there.
For more information, read the Zulip discussion https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/no.20space.20left.20on.20device.20(tmpfs).20when.20compiling.20rustc
The text was updated successfully, but these errors were encountered: