strong-processor-70970
02/18/2025, 11:34 AMGitlab step I want to run:
This is my template where I install stuff, like jq, curl, git and Pants itself.
.install-deps:
stage: install-and-authenticate
image: python:3.10.14-slim
before_script:
- apt-get update && apt-get -y install gettext-base jq default-jdk
- apt-get -y install curl git
- export PATH="/root/.local/bin:$PATH"
- curl --proto '=https' --tlsv1.2 -fsSL <https://static.pantsbuild.org/setup/get-pants.sh> | bash
- pip install --no-cache-dir -i <https://some_wweb/repository/pypi-group/simple> poetry==1.8.1
I just curled pants here for testing.
And this is the stage in my gitlab-ci.yaml that I run Pants:
run-unit-tests-pants:
extends: .install-deps
stage: run_pants_tests
script:
- pants --version
- pants --print-stacktrace -ldebug --changed-since=origin/main tailor --check fmt
- pants --changed-since=origin/main --changed-dependents=transitive test
rules:
- changes:
- src/**/*
- pyproject.toml
- poetry.lock
- .gitlab-ci.yml
if: $DEPLOYMENT_ENV != "prod"
cache:
key: "$CI_COMMIT_REF_SLUG"
paths:
- .pants.d/
needs: [ ]
Pants works properly, I can see the version But somehow git interaction has some problems in my setup. I get this error:
16:08:01.34 [DEBUG] Detected git repository at /builds/repo/processing on branch None
16:08:01.34 [DEBUG] computed 1 nodes in 0.019808 seconds. there are 45 total nodes.
16:08:01.34 [DEBUG] Launching 1 roots (poll=false).
16:08:01.34 [DEBUG] Starting: Find all targets in the project
16:08:01.45 [DEBUG] Starting: Generate `python_requirement` targets from Poetry pyproject.toml
16:08:01.47 [DEBUG] Completed: Generate `python_requirement` targets from Poetry pyproject.toml
16:08:01.61 [DEBUG] Completed: Find all targets in the project
16:08:01.61 [DEBUG] computed 1 nodes in 0.272870 seconds. there are 2613 total nodes.
16:08:01.65 [DEBUG] Executing: /usr/bin/git --git-dir=/builds/repo/processing/.git --work-tree=/builds/repo/processing diff --name-only origin/main...HEAD -- /builds/repo/processing
16:08:01.66 [ERROR] fatal: bad revision 'origin/main...HEAD'
And afterwards again:
pants.core.util_rules.system_binaries.GitBinaryException: fatal: bad revision 'origin/main...HEAD'
Have you faced this issue, any ideas how to solve?square-psychiatrist-19087
02/18/2025, 1:04 PMgit diff origin/main...HEAD
Does it work?some-summer-37322
02/18/2025, 2:08 PMvariables:
GIT_STRATEGY: clone
GIT_DEPTH: "0"strong-processor-70970
02/18/2025, 6:15 PMGIT_DEPTH did the trick. Ty!strong-processor-70970
02/18/2025, 6:29 PMnative_engine.PantsdClientException: The pantsd process was killed during the run.
If this was not intentionally done by you, Pants may have been killed by the operating system due to memory overconsumption (i.e. OOM-killed). If you keep seeing this error message, try the troubleshooting steps below. If none of those help, please consider filing a GitHub issue or reaching out on Slack so that we can investigate the possible memory overconsumption (<https://www.pantsbuild.org/docs/getting-help>).
And during test run, somehow I see Building pytest_runner.pex multiple times.
Maybe a cache related issue?square-psychiatrist-19087
02/18/2025, 6:30 PMsome-summer-37322
02/19/2025, 6:55 AMstrong-processor-70970
02/20/2025, 11:29 AM