Build ccache from source #91
Merged
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.
The change modifies the Debian, RHEL, and Ubuntu images to build from source.
As suggested in #90 (review), I first explored using the GCC image as a base to build ccache, and then copy it into the final GCC and Clang images. However, this resulted in two issues:
I considered building a wholly separate image, e.g. a
tools-rippled-ccache, to use as base image in which GCC would be installed and then ccache built from source, upon which it could be copied into the distro images. However, this has its own drawbacks:(Note that we already have this issue with the GCC base image in the
docker/gccdirectory, used by Debian, so I prefer to not add more such cases.)So, to keep things simple at the expense of duplication (of which there already is a bit; unfortunately Docker doesn't support importing a bunch of instructions from another Dockerfile), I build ccache from source in both the GCC and Clang final images.
Note that the gold linker in RHEL 8 is so old that it doesn't support a compiler flag used by ccache, so I've configured it to use the default linker instead.