Add opt-in support for ccache while installing via pip. #785
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is to keep the AMUSE and OMUSE
setup_codes.py. In OMUSE I currently run tests against the tarballs created bypython setup.py sdistinstead of in place (like AMUSE), to ensure the generated sdists actually work. Unfortunately,pipwill run the install in a randomized temporary directory, which breaks the ccache caching and makes the OMUSE CI really slow.To workaround this, I changed
setup_codes.pyto look forAMUSE_USE_CCACHEin the environment and, if it is set, adding an appropriateCCACHE_BASEDIRbefore compiling the embedded code. This dramatically increases the cache hit rate of ccache on the CI.The change only affects users who: 1) use ccache and 2) explicitly opt-in by setting
AMUSE_USE_CCACHEin their environment (and even then only when there is no explicitCCACHE_BASEDIRis set), so it should be safe to merge.