-
Notifications
You must be signed in to change notification settings - Fork 139
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
golang package are not cp to the .gitlab-ci-local/cache directory #1170
Comments
Are you aware that the commands are being executed on your local machine, and not inside a docker container ? |
Hi @firecow , variables:
CI_DEBUG_TRACE: "true"
FF_USE_FASTZIP: "true"
GOLANG_VERSION: "1.22.1"
.go-cache:
variables:
GOPATH: $CI_PROJECT_DIR/.go
before_script: |
mkdir -p "${GOPATH}"
chown -R :users $CI_PROJECT_DIR
chmod -R a+rwX $CI_PROJECT_DIR
cache:
paths:
- "${GOPATH}/pkg/mod/"
- "${GOPATH}/bin"
image:
name: golang:${GOLANG_VERSION}
stages:
- build
build-job:
stage: build
extends: [.go-cache]
script: |
go build During this process two containers are launch golang:1.22.1 and gitlab-local-ci. |
It cannot reproduce using this example. |
I have setup this small test project to ensure we are seeing the same thing. |
Right, thanks that gave me/us the error to debug on
|
Under the hood, we're using
Unluckily, in golang, the packages installed are read-only resulting in this bug For now, i'll recommend the following tempfix: script:
- go build
- |
# HACK: https://github.com/firecow/gitlab-ci-local/issues/1170#issuecomment-2081111816
if [[ $GITLAB_CI == "false" ]]; then
find "${GOPATH}/pkg/mod/" -type d -exec chmod +w {} +
fi |
I wonder what Gitlab CI/CD runners use... |
@firecow So I just checked what's in the cache on our deployed Gitlab runner and each cache is a zip file (not even a tar.gz, but a zip file). The cache folder on the server is organized like:
The contents of each zip is just all the files/folder structure with paths relative to the repo root. |
I have a job that build a golang binaries. After downloading all the dependencies the job failed to cp all dependencies to the cache directory
Minimal .gitlab-ci.yml illustrating the issue
Expected behavior
I was expected for the cache mechanism to work but instead I have :
Host information
macos
gitlab-ci-local 4.47.0
Containerd binary
I am using docker
Additional context
I've check the docker.io/firecow/gitlab-ci-local-util container and there is no volumes attached to it, despite this docker create
The text was updated successfully, but these errors were encountered: