Building an ebuild that's running on it special circumstance, it will disable too the space left on the disk and here I comment why. Keepwork is an special feature that help you to CONTINUE the, for any cause, stopped work. Real example: I recently tried building the Libreoffice 5.0.2 with debug symbols (hours gigs of memory and gigs of temp are required), but without special features like keepwork. My free space available is 5GB and Libreoffice stop and warn on the pre-merge pass because no space available, requiring 6GB. Then, I create on device annexed one loopback temporary file of "exceeded" 12GB, dedicated for build that. Emerge runs the building, but 12GB is insufficient for building with symbols (other bug, commented below), so stopped when disk capacity is full with "no space left". Then I increased manually only 2GB for try. Next, I run emerge with the keepwork feature (for saving hours of building) and it requires another time 6GB of free space. The keepwork feature will disable the space checking on temporary device, especially if it can detect the same instance that will write. Comment: Playing with the requirements, emerge will check another space requirement when -gdb are selected, because libreoffice 5.0 requires MORE THAN 21GB OF TEMP, not precisely 6GB! But this is another bug.
Sorry for the faulty text, I should check first...
Another solution is if emerge detect the same instance on temporary dir, it can rest the directory space used actually to the limit required by the ebuild.
FEATURES=keepwork is more of a debugging tool than anything else. It's not intended for general use. You probably want FEATURES=ccache instead.
From the make.conf man page: keepwork Do not delete the ${WORKDIR} directory after the merge process. ${WORKDIR} can then be reused since this feature disables most of the clean phase that runs prior to each build. Due to lack of proper cleanup, this feature can interfere with normal emerge operation and therefore it should not be left enabled for more than a short period of time.
Yes I know, but not delete the temporary files before or after, and you can continue the build operation. Ccache probably is a good engine, but the man page warns the first build is slower and I need build only one time. Nevertheless The base of the bug is on keepwork, not on ccache. I think removing or resting space required on detected instance is a good feature/solution for limited spaces. Regards.