Skip to content
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

gitlab-runner: ERROR: Job failed: the GIT_CLONE_PATH="/Users/admin/builds/aquareum" has to be within "/private/tmp/builds" #90

Open
iameli opened this issue Oct 30, 2024 · 2 comments

Comments

@iameli
Copy link

iameli commented Oct 30, 2024

Cross-posting this because I'm not sure how to tell whether it's gitlab-runner's fault or gitlab-tart-executor's fault. GitLab ticket here.

Hi! For unimportant reasons, my build is failing when running in /private/tmp/builds, so I need to run it elsewhere, such as /Users/admin/builds. I believe this should work, for two separate reasons:

  1. I have this setting enabled on the runner:
  [runners.custom_build_dir]
    enabled = true

Which should allow me to pick a custom directory.

  1. I have this setting set on the runner:
[[runners]]
  builds_dir = "/Users/admin/builds"
  cache_dir = "/Users/admin/cache"

Which should make /Users/admin/builds into the default directory. Despite that, the build refuses to start:

Running with gitlab-runner 17.5.2 (c6eae8d7)
  on  adMiXAHcd, system ID: s_26bd3ddecc3d
Preparing the "custom" executor
00:00
Using Custom executor...
WARNING: Cleanup script failed: exit status 1
ERROR: Job failed: the GIT_CLONE_PATH="/Users/admin/builds/aquareum" has to be within "/private/tmp/builds"

Full runner config is here:

concurrent = 2

[[runners]]
  builds_dir = "/Users/admin/builds"
  cache_dir = "/Users/admin/cache"
  output_limit = 100000
  executor = "custom"
  token = "redacted"
  url = "https://git.aquareum.tv"
  [runners.custom_build_dir]
    enabled = true
  [runners.feature_flags]
    FF_RESOLVE_FULL_TLS_CHAIN = false
  [runners.custom]
    config_exec = "/opt/homebrew/bin/gitlab-tart-executor"
    config_args = ["config"]
    prepare_exec = "/opt/homebrew/bin/gitlab-tart-executor"
    prepare_args = ["prepare"]
    run_exec = "/opt/homebrew/bin/gitlab-tart-executor"
    run_args = ["run"]
    cleanup_exec = "/opt/homebrew/bin/gitlab-tart-executor"
    cleanup_args = ["cleanup"]

Pertinent pipeline config is here (and full pipeline is here:

build-mac:
  stage: build
  interruptible: true
  image: ghcr.io/cirruslabs/macos-runner:sequoia
  variables:
    GIT_CLONE_PATH: "/Users/admin/builds/aquareum"
  tags:
    - tart-installed
  timeout: 2 hours
  script:
    - git fetch --unshallow || echo 'already unshallow'
    - brew install ninja go openssl@3 && go version
    - sudo gem uninstall xcodeproj -x --ignore-dependencies
    - sudo gem install xcodeproj -v 1.25.1
    - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh && bash rustup.sh -y && rm rustup.sh
    - export PATH="$PATH:$HOME/.cargo/bin"
    - echo $PATH
    - 'echo "which xcodeproj: $(which xcodeproj)"'
    - 'echo "xcodeproj --version: $(xcodeproj --version)"'
    - "$(which xcodeproj) --version"
    - >
      brew install [email protected]
      && python3.11 -m pip install virtualenv
      && python3.11 -m virtualenv ~/venv
      && source ~/venv/bin/activate
      && pip3 install meson
      && make ci-macos -j16
      && make selftest-macos

I've worked around the issue by just moving the clone directory at the start of the script, but that's kind of bogus:

  script:
    - cd ..
    - mv aquareum /Users/admin/aquareum
    - cd /Users/admin/aquareum
@iameli-streams
Copy link

Although you have enabled custom build directories in the runner configuration, some versions of GitLab Runner may restrict the path. Make sure the GitLab Runner version you use supports custom build directories.

In addition, homebrew is not very friendly to Mac. You can try Servbay, which is more professional than homebrew on Mac.

@naizhao Come collect your bot, it's lost and spamming your product on completely unrelated GitHub issues

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

No branches or pull requests

3 participants
@iameli @iameli-streams and others