-
- Downloads
Makefile: fix default ref format propagating into build prereqs
The `test-with-reftable` CI job executes the "test-go" target, where the only difference to our normal test target is that it also exports the "GIT_DEFAULT_REF_FORMAT" environment variable. This environment variable gets exported into all dependencies, which causes us to initialize repos other than the test repositories created by our actual unit tests with the "reftable" format. This includes for example the bundled Git repos. This causes an issue with CI caches: it can happen that a job gets a CI cache that uses the "files" format for the bundled Git repos, but the default ref format is "reftable". This causes the following error when reinitializing the directoy: fatal: could not open '/builds/gitlab-org/gitaly/_build/deps/git-v2.48/.git/refs/heads' for writing: Is a directory The issue here is that git-init(1) tries to reinitialize the repository with the wrong ref format. When doing so it wants to write "refs/heads" as a file containing garbage to keep other Git clients which aren't yet aware of the "reftable" format from reading the repository. But because the repo uses the "files" format the path is a directory, and thus writing the file fails. The issue can be trivially reproduced with an up-to-date Git version: $ git init --ref-format=files repo Initialized empty Git repository in /tmp/repo/.git/ $ GIT_DEFAULT_REF_FORMAT=reftable git init repo fatal: could not open '/tmp/repo/.git/refs/heads' for writing: Is a directory Even though this is an upstream bug, it still doesn't make sense for us to propagate the `GIT_DEFAULT_REF_FORMAT` environment variable into all build prerequisites. Fix this by using a Gitaly-specific environment variable instead and setting it up when configuring our tests.
-
mentioned in commit b035aae4
-
mentioned in merge request !7600 (merged)
Please register or sign in to comment