-
Notifications
You must be signed in to change notification settings - Fork 54
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
CCACHE_DIR environment variable is ignored by action #96
Comments
I agree. Do you want to send a PR? |
Maybe we can even stop overriding the cache dir. I’m not sure why we do it. |
Without any context my guess is this is done to keep all files generated during the action in the workspace directory. It might be good to keep this behavior and override the environment variable by using the Even though the cache_dir is set in the config that is overriden by the environment variable. https://ccache.dev/manual/latest.html#_configuration |
@n3world Whats the use case of overriding |
I do not think I know exactly what you are asking so I'll just explain the situation a bit more. CCACHE_DIR is currently set in the environment in which this action runs. This action does not check the setting of that variable and always tries to use Two ways to resolve this would be this action honors the environment variable and puts everything there or it overrides it and uses the directory it wants to. I was suggesting to go with the later fix since that provides more isolation and less likely to have issues if multiple compilations are using the same filesystem, fighting over setting configuration values in the configuration file and cache bloat. If you were actually asking why the environment variable is set in the first place I don't think that it is too important but for me it is part of the docker container environment. The container is used for development and there it is convenient to have one volume location for the ccache just for consistency in scripts across all users. |
Thanks @n3world, that makes it more clear to me. You explained it is a side effect of re-using a docker container for development and CI. That's what I meant with "accidental". I understand you are not asking for implementing the possibility to override However this is harder to fix than it seems. Afaik steps in a workflow are isolated. Removing @n3world Can you tell me where I suggest to add a troubleshooting section in the Readme. |
I know in steps you can write to
If it is just set in the build script and not global this action couldn't do anything about that, other than just documenting that CCACHE_DIR being set breaks this action
It is in the environment for the docker image so it is there for anything using that image. |
Getting back to the question raised in #96 (comment): why do we need to override the cache directory? In particular, storing it inside the worktree causes unintended consequences for actions that push back to the Git repository. If we must override, I propose to store it alongside the worktree. |
Currently, if environment variables are set for CCACHE_DIR or SCCACHE_DIR then this action will ignore them and hardcode its own. This is a problem if CCACHE_DIR is set for example in a docker file environment which is very hard to eliminate Fixes #96
If the CCACHE_DIR environment variable is set ccache will use that for its cache location but ccache-action is hardcoded to use
.${ccacheVariant}
. The action should either honor CCACHE_DIR or set it to the hard coded path.The text was updated successfully, but these errors were encountered: