Problem when building on Teamcity Build Agents

Hello,

we’re using Teamcity as our CI/CD-Tool. I’m right now developing an application mainly on a Liligo-TSim7000g, but with other, simpler, boards also as environments.

The build was fine, until I needed to switch the main platform SDK from Arduino to espdf with Arduino as an AddOn.

Since then, our server won’t build anymore, neither on a normal (Windows-) Agent nor within a Docker-Container.

The error is

[15:25:31]W: [Step 7/7] fatal: not a git repository (or any of the parent directories): .git
[15:25:31]W: [Step 7/7] CMake Error at .pio/build/lilygo-t-sim7000g_with_Audio/CMakeFiles/git-data/grabRef.cmake:48 (file):
[15:25:31]W: [Step 7/7] file failed to open for reading (No such file or directory):
[15:25:31]W: [Step 7/7]
[15:25:31]W: [Step 7/7] /opt/buildagent/work/3219960388f4e687/.pio/build/lilygo-t-sim7000g_with_Audio/CMakeFiles/git-data/head-ref
[15:25:31]W: [Step 7/7] Call Stack (most recent call first):
[15:25:31]W: [Step 7/7] /root/.platformio/packages/framework-espidf/tools/cmake/third_party/GetGitRevisionDescription.cmake:80 (include)
[15:25:31]W: [Step 7/7] /root/.platformio/packages/framework-espidf/tools/cmake/third_party/GetGitRevisionDescription.cmake:90 (get_git_head_revision)
[15:25:31]W: [Step 7/7] /root/.platformio/packages/framework-espidf/tools/cmake/project.cmake:61 (git_describe)
[15:25:31]W: [Step 7/7] /root/.platformio/packages/framework-espidf/tools/cmake/project.cmake:472 (__project_get_revision)
[15:25:31]W: [Step 7/7] CMakeLists.txt:4 (project)
[15:25:31]W: [Step 7/7]
[15:25:31]W: [Step 7/7]
[15:25:31]W: [Step 7/7] fatal: not a git repository (or any of the parent directories): .git
[15:25:31]W: [Step 7/7] fatal: not a git repository: /root/.platformio/packages/framework-espidf/components/openthread/openthread/…/…/…/.git/modules/components/openthread/openthread

Of course I’ve searched the internet for any causes, but I can’t fix it.

Additional info: the build runs fine on normal developer machines using pio run, just not within Teamcity.

Can anybody give me a hint why the build fails since I switched the main platform SDK?

If required, I can of course provide platformio.ini or any other files.

Best Regards,
Oliver

Can your CI thingy build https://github.com/platformio/platform-espressif32/tree/develop/examples/espidf-arduino-blink? If yes, the fault is in your specific project. If no, the fault is in the CI system, because Github Actions can compile this just fine.

We tried what you suggested and it failed as well. Then we investigated the steps performed more in depth with more people. We noticed that there’s a step which evaluates the branch name which failed on our system.

We’re not sure why, but we seem to have fixed it by changing the way the project is checked out on the build agent from our git-repo.

So if anyone is interested and can maybe confirm that this change is necessary, this is what we did:
First thing we changed was the branch name from refs/heads/master to just master, the second was to change the “useAlternates”-Flag from “Auto” to “NoMirrors”

So now everything is building fine. Thank you.