Warn when running low on disk space when performing certain editor operations#105755
Warn when running low on disk space when performing certain editor operations#105755Calinou wants to merge 1 commit intogodotengine:masterfrom
Conversation
c49f784 to
a71811a
Compare
a71811a to
2244457
Compare
|
I increased it to 100GB everywhere to test the warning. The warning is not yet displayed in the On MacOS, according to "Finder" I have more free space. |
I've added the warning to all advanced import settings dialogs.
This is a GiB (binary prefix) versus GB (decimal prefix) difference. It's why when you buy a 500 GB hard drive, it appears to be 465 GB in the OS 🙂 |
2244457 to
7e9eb3d
Compare
Alex2782
left a comment
There was a problem hiding this comment.
Looks good, tested on MacOS and Android.
I think this might be too restrictive. Some people can use Godot on mobile devices (tablets, phones, Steam Deck) where storage is at a premium, and it's totally reasonable to export e.g. a simple 2D game with 200 MB of assets when you're on a 64 GB SD card with only 3-4 GB left. Ideally we should get a feeling for how heavy the PCK is going to be (e.g. by checking the size of I haven't tested the PR to check, but if we can't get a level of accuracy which actually matches the developer's available disk space and project needs, maybe we should just have the possibility to disable these warnings for users who know they're operating within narrow limits. |
I would say there should be different types of warnings. In output (warnings/errors depending on severity), and in extreme cases (0-50MiB free) warn the user with a dialog when they open a project. Especially as this will continue being an issue until the user intervenes to free up space. I'm guessing even a modest Either way it would be nice to get something in for 4.4.2 (or 4.5). At least for the worst-case-scenarios, even if it does not touch the export process (although I would hope that actually running out of data here would just fail/cancel the export). |
7e9eb3d to
fd96935
Compare
fd96935 to
d095a66
Compare
…erations The following editor operations will now warn the user if the available space on the target disk is low: - Saving a scene (< 1 GiB). - Importing a set of resources (< 2 GiB). - Downloading an export template (< 1 GiB, checked per-file). - Installing export templates from a TPZ (< 4 GiB). - Exporting a project (< 10 GiB). - Packing a project as a ZIP file (< 10 GiB).
d095a66 to
0a5fe2e
Compare
|
Rebased and tested again, it works as expected. I've applied the fix from #118924 (thanks @aurpine) 🙂
This should be possible by looping over all files in |
| static void add_init_callback(EditorNodeInitCallback p_callback) { _init_callbacks.push_back(p_callback); } | ||
| static void add_build_callback(EditorBuildCallback p_callback); | ||
|
|
||
| void check_disk_space(const String &p_target_path, float p_size_gib, const String &p_rationale) const; |
There was a problem hiding this comment.
This can be static and then you won't need get_singleton at the callsites.
| if (dir->get_space_left() < 10 * Math::pow(1024.0, 3.0)) { | ||
| // Less than 10 GiB available. | ||
| WARN_PRINT(vformat("Current available space on disk is low (%s). MovieWriter will fail during movie recording if the disk runs out of available space.", String::humanize_size(dir->get_space_left()))); | ||
| WARN_PRINT(vformat("%s: Current available space on disk is low (%s). MovieWriter will fail during movie recording if the disk runs out of space.", path, String::humanize_size(dir->get_space_left()))); |
There was a problem hiding this comment.
We can use check_disk_space here too.



The following editor operations will now warn the user if the available space on the target disk is low:
and Invalid PCK on export when running out of disk space #105742.