cache distributed on windows runner
Description: distributed cache resolved windows path when gitlab windows runner is running in git-bash environment as a shell executor
Proposal: fix the gitlab windows runner to resolve the path based on executor type
Links to related issues and merge requests / references:
config.toml without cachedir configured
\[H\[2J\[3Jsection_end:1712845751:get_sources
\[0Ksection_start:1712845751:restore_cache
\[0K\[0K\[36;1mRestoring cache
\[0;m\[0;m \[32;1mSkipping cache extraction due to inability to make the cache file path relative to the build directory (is the build directory absolute?)
\[0;m \[32;1mSkipping cache extraction due to inability to make the cache file path relative to the build directory (is the build directory absolute?)
\[0;m \[H\[2J\[3Jsection_end:1712845751:restore_cache
config.toml with cache_dir=/c/workspace/builds/cache
\[32;1mChecking cache for 2187953-csharp:inspectcode-3-non_protected...
\[0;m Runtime platform arch=amd64 os=windows pid=11840 revision=656c1943 version=16.9.0
\[0;33mWARNING: mkdir ..\\..\\..\\..\\cache\\test\\2187953-csharp:inspectcode-3-non_protected: The directory name is invalid.
\[0;m \[0;33mFailed to extract cache
\[0;m \[32;1mChecking cache for gitlab/debug-380242-csharp:inspectcode-3-non_protected...
\[0;m Runtime platform arch=amd64 os=windows pid=11840 revision= 656c1943 version=16.9.0
\[0;33mWARNING: mkdir ..\\..\\..\\..\\cache\\test\\gitlab\\debug-380242-csharp:inspectcode-3-non_protected: The directory name is invalid.
\[0;m \[0;33mFailed to extract cache
config.toml
[[runners]]
url = "https://gitlab.example.com/ci"
token = "[REDACTED]"
tls-skip-verify = false
tls-ca-file = ""
output_limit = 655360
name = "builder-gcp-win-build21-buildbot"
builds_dir = "/c/gitlabrunner/buildbot/workspace/builds"
cache_dir = "C:/gitlabrunner/buildbot/workspace/builds/cache" (or C:\\gitlabrunner\\buildbot\\workspace\\builds\\cache or /c/workspace/builds/cache) (or remove this entry)
executor = "shell"
shell = "bash"
limit = 6
Edited by Sokunrotanak Srey (Rotanak)