Skip to content

Allow ccache to reuse results across build directories #1087

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 24, 2024

Conversation

eramongodb
Copy link
Contributor

The CXX Driver equivalent of changes in mongodb/mongo-c-driver#1522. Verified by this patch.

The only caveat is that the CXX Driver does not have its own ccache detect-and-use routine a la CCache.cmake in the C Driver, so each instance of setting the ccache environment variables is preceeded by a test for ccache being present.

For consistency, other instances of the ccache test have been changed to use the same command -V method, which prints the path to the ccache binary when present in an informative manner (e.g. ccache is /usr/bin/ccache) in lieu of the explicit message that was being used prior.

@eramongodb eramongodb requested a review from kevinAlbs January 24, 2024 20:19
@eramongodb eramongodb self-assigned this Jan 24, 2024
Copy link
Collaborator

@kevinAlbs kevinAlbs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with one path fix.


# Allow reuse of ccache compilation results between different build directories.
export CCACHE_BASEDIR CCACHE_NOHASHDIR
CCACHE_BASEDIR="$(pwd)"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
CCACHE_BASEDIR="$(pwd)"
CCACHE_BASEDIR="$(pwd)/mongo-cxx-driver"

To refer to source directory path.

@eramongodb eramongodb merged commit e58dfa6 into mongodb:master Jan 24, 2024
@eramongodb eramongodb deleted the cxx-ccache branch January 24, 2024 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants