You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
build-and-deploy: use a home directory with a shorter path
The path `${{ github.workspace }}/home` was apparently almost too long
already, with the repository name `git-for-windows-automation` repeated
_twice_ in it, and when we started using self-hosted runners whose agent
directory is called `C:\actions-runner` (as opposed to GitHub hosted
runners that have it in `D:\a`), it tipped the balance.
This matters because we want to use GNU Privacy Guard, which insists on
the full path of the `gpg-agent` socket to fit inside
`sockaddr_un.sun_path` (which only 108 bytes long). The symptom we see
is that importing GPG keys fails with a lapidary "gpg: can't connect to
the agent: IPC connect call failed".
The secret is lifted only when debugging a big further, e.g. by adding
a `gpg-agent.conf` in `$HOME/.gnupg/` with contents like this one:
debug-level guru
debug-all
log-file /tmp/gpg-agent.debug.log
Then, that log file will contain some hints like this one:
2023-01-02 20:46:25 gpg-agent[1018] listening on socket '/c/actions-runner/_work/git-for-windows-automation/git-for-windows-automation/home//.gnupg/S.gpg-agent'
2023-01-02 20:46:25 gpg-agent[1018] socket name '/c/actions-runner/_work/git-for-windows-automation/git-for-windows-automation/home//.gnupg/S.gpg-agent.extra' is too long
A similar issue was reported at
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=847206, but sadly the
suggested command `gpgconf --create-socketdir` fails, not only because
`/run/user/<uid>` does not exist, but even when that directory is
created, the command falls prey to the vast differences between Windows'
and Unix' permission model, and it thinks that the directory's
permissions are too lax and refuses to do its job.
So let's do the next best thing and use a home directory that is not
inside a deep path, but instead directly inside the runner's temporary
path.
Signed-off-by: Johannes Schindelin <[email protected]>
0 commit comments