yrnkrn / zapcc

zapcc is a caching C++ compiler based on clang, designed to perform faster compilations
Other
1.25k stars 61 forks source link

Any simple way to duplicate zapccs before compile, to avoid closing from compile errors? #40

Closed sirius0xff closed 4 years ago

sirius0xff commented 4 years ago

Currently zapccs close itself whenever there is compilation error.

I can imagine the error may made the cache invalid and it is very hard to restore the cache to original state, before compilation happens.

I think a simple workaround is simply backup the server and the whole cache before every compile, then if the new compile goes wrong, it can just restore to the old cache.

Are there simple ways to achieve this?

yrnkrn commented 4 years ago

Compilation errors leave the clang/zapcc data structures inconsistent and unsuitable for further compilation. Backing up before compilation may be possible by duplicating the zapccs process and cleaning up, but will tie up extra memory and slow down compilation when there were no errors, which is the usual case when building a big project such as LLVM. Ideally that would be an option used only for interactive development.

sirius0xff commented 4 years ago

Yes, that would be very helpful for development. I suspect something like docker maybe able to freeze, duplicate and restore the process?

yrnkrn commented 4 years ago

docker pause and docker save ? maybe. An overhead, though. Lower level maybe fork with fixes for open handles would work.