Skip to content

Let git read the tree the runner checked out - #36

Merged
NiKrause merged 1 commit into
mainfrom
ci/release-safe-directory
Sep 18, 2026
Merged

NiKrause merged 1 commit into
mainfrom
ci/release-safe-directory

Conversation

@NiKrause

Copy link
Copy Markdown
Collaborator

The first release build (run 35366242511) configured wine, installed pyinstaller, and then stopped:

fatal: detected dubious ownership in repository at '/opt/wine64/drive_c/electrum-doi'
🗯 ERROR: build-electrum-git failed

The checkout belongs to the runner user, the container runs as root, and git refuses a working tree it does not own. build-electrum-git.sh takes the version from

VERSION=`git describe --tags --dirty --always`

so that is exactly where it ends — and the message says nothing about the build, which is why it reads like a compiler failure.

It cannot happen locally. Docker Desktop maps the mount to the calling user, so the ownership check passes. The trap only appears on a Linux runner, which is the first time this build has ever run on one.

Reproduced, then fixed

In a debian:trixie container with the tree chowned to another uid:

=== without the fix (git as root, tree owned by 1001) ===
fatal: detected dubious ownership in repository at '/work'

=== with GIT_CONFIG_* in the environment ===
dc4.1.7

Set through GIT_CONFIG_COUNT / GIT_CONFIG_KEY_0 / GIT_CONFIG_VALUE_0 on the container rather than by writing a .gitconfig into the image or a safe.directory line into the tree, so nothing the build itself sees changes — which matters when the point of the exercise is comparing its output byte for byte.

Meanwhile, the local build finished

e37ebc432f75575bd13548e7b8acbb161c5d9a72c7e0628e2c159362e2e881e1  electrum-doi-dc4.1.7-portable.exe
9a46187c8061f05b6754851d3206000cc5dc1f28367471a818c4e4ca5220f113  electrum-doi-dc4.1.7-setup.exe
89e1cbd9e1fc3019afee91baa1e9731dad0add25f14d4794ca249a2a72671e55  electrum-doi-dc4.1.7.exe

Once this is merged I will dispatch the workflow on dc4.1.7 again and compare against these three.

🤖 Generated with Claude Code

The first release build got as far as configuring wine and then stopped:

    fatal: detected dubious ownership in repository at
           '/opt/wine64/drive_c/electrum-doi'

The checkout belongs to the runner user, the container runs as root, and git
refuses a working tree it does not own. build-electrum-git.sh takes the
version from `git describe --tags`, so that is where the build ends -- with
no hint that ownership was the problem.

It does not happen locally: Docker Desktop maps the mount to the calling
user, so the check passes and the trap only shows up on a Linux runner.

Set through GIT_CONFIG_COUNT/KEY/VALUE on the container rather than by
writing a .gitconfig into the image or a safe.directory line into the tree,
so nothing the build itself sees changes.

Reproduced before and after in a debian:trixie container with the tree
chowned to another uid: `git describe` fails with that exact message, and
returns dc4.1.7 with the variables set.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@NiKrause
NiKrause merged commit 29c21ff into main Sep 18, 2026
4 checks passed
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

Successfully merging this pull request may close these issues.

1 participant