Locally executed test (circleci local execute rocky8) with circleci (version 0.1.29041+68d2c20) throws:
Error: /bin/sh: git: command not found
followed by (because of missing source code):
make: *** No rule to make target 'rpm'. Stop.
Error:
Exited with code exit status 2
Step failed
Error: runner failed (exited with 101)
Task failed
Error: task failed
Either git or ssh (required by git to clone through SSH) is not installed in the image. Falling back to CircleCI's native git client but the behavior may be different from official git. If this is an issue, please use an image that has official git and ssh installed.
Best way to mitigate the warning and to fix the error seems to add git to the list of packages to be installed inside the container, ensure that /tmp/_circleci_local_build_repo is recognized by git as safe directory (cause Error: fatal: detected dubious ownership in repository otherwise) and changing the build-rpm steps that package install and safe directory command running before checkout.
Locally executed test (
circleci local execute rocky8
) with circleci (version 0.1.29041+68d2c20) throws:followed by (because of missing source code):
Assumption why there is only a warning in https://app.circleci.com/pipelines/github/aws/efs-utils/237/workflows/574450d2-c225-4b9f-80f9-dfdcd153b530/jobs/4504/parallel-runs/0/steps/0-101: Older CircleCI version or if you run the tests online and not locally, seem to ship a build-in
git
binary as fallback, which cause a warning and recommendation to switch to a container image that includesgit
already.Best way to mitigate the warning and to fix the error seems to add
git
to the list of packages to be installed inside the container, ensure that/tmp/_circleci_local_build_repo
is recognized by git as safe directory (causeError: fatal: detected dubious ownership in repository
otherwise) and changing thebuild-rpm
steps that package install and safe directory command running beforecheckout
.from
to
Successfully tested with all builds that rely on
build-rpm-package
: