Closed as not planned
Closed as not planned
Copy link
Description
Prerequisites
- I have written a descriptive issue title
- I have searched issues to ensure it has not already been reported
GitVersion package
GitVersion.MsBuild
GitVersion version
6.8.2
Operating system
Linux
What are you seeing?
Linux runners on GitHub have switched to a more hardened sandbox. They now reject the creation of the GitVersion mutex, see
| using var mutex = new Mutex(true, $@"Global\gitversion{mutexName}", out var acquired); |
The error produced is:
The system cannot open the device or file specified. : 'Global\gitversionhomerunnerworkdotnet-debouncedotnet-debounce.git'
The reason is that the Linux sandbox rejects the \ in the path. I understand that the Global\ prefix is for Windows. Maybe the name should be OS-dependent, so Linux is not confronted with backslashes.
EDIT: see analysis from @arturcic below, which is correct
What is expected?
GitVersion works on GitHub Linux runners.
Steps to Reproduce
Create a .NET solution with two (or more) projects using GitVersion.MsBuild that can build concurrently and use a GitHub Linux runner.
RepositoryFixture Test
No response
Output log or link to your CI build (if appropriate).
The system cannot open the device or file specified. : 'Global\gitversionhomerunnerworkdotnet-debouncedotnet-debounce.git'
/home/runner/work/dotnet-debounce/dotnet-debounce/.nuget/packages/gitversion.msbuild/6.8.2/tools/GitVersion.MsBuild.targets(32,9): error MSB3073: The command "dotnet --roll-forward Major "/home/runner/work/dotnet-debounce/dotnet-debounce/.nuget/packages/gitversion.msbuild/6.8.2/tools/net8.0/gitversion.dll" "/home/runner/work/dotnet-debounce/dotnet-debounce/Debounce" -output file -outputfile "obj/gitversion.json" -allowshallow" exited with code 1. [/home/runner/work/dotnet-debounce/dotnet-debounce/Debounce/Debounce.csproj::TargetFramework=netstandard2.0]
Activity
[-][ISSUE]: Mutex name (containing 'Global\') fails on GitHub CodeQL Linux runners[/-][+][ISSUE]: Mutex name (containing 'Global\') fails on GitHub Linux runners[/+][-][ISSUE]: Mutex name (containing 'Global\') fails on GitHub Linux runners[/-][+][Bug] GitVersion.MsBuild fails to create named mutex in Linux CodeQL builds[/+]arturcic commentedon Oct 15, 2026
Thanks for reporting this. Codex here, responding on behalf of @arturcic.
This appears related to the .NET Unix named-mutex storage change, introduced in .NET 8.0.32 and 10.0.13. Named mutexes now default to user scope and require accessible user-owned storage. On Linux,
XDG_RUNTIME_DIRcan provide that storage.We reproduced the same exception using the published GitVersion.MsBuild 6.8.2 executable, without changing its binaries:
XDG_RUNTIME_DIRWe tested these comparisons on Linux ARM64 and additionally verified the .NET 8 comparison on AMD64. Removing the
Global\prefix did not resolve the failure, so the backslash does not appear to be the cause.We have not captured the exact storage conditions inside your failing CodeQL job, but the runtime change provides a reproducible explanation.
Could you try adding this step before
dotnet restoreanddotnet buildin the Linux job?mktemp -dcreates a private directory owned by the runner user. Provision it once per job so subsequent steps and concurrent GitVersion processes inherit the same directory. We verified that using separate directories per invocation breaks mutex coordination.Please let us know whether this allows your Linux CodeQL build to complete.
[-][Bug] GitVersion.MsBuild fails to create named mutex in Linux CodeQL builds[/-][+][Bug] GitVersion.MsBuild fails to create named mutex in Linux builds with concurrent projects[/+]dorssel commentedon Oct 15, 2026
Yes, you are right! My original analysis was incorrect.
It is a concurrency problem when multiple projects using GitVersion.MsBuild can build concurrently as the first projects to build. The two GitVersion jobs clash. In my case it was actually a single project that builds concurrently for both net8.0 and netstandard2.0 targets (using the .NET 10.0.402 compiler).
It also happens on normal builds, not related to just CodeQL. It is indeed the update to .NET SDK 10.0.402.
Workaround fixes it!
dorssel commentedon Oct 15, 2026
Oops ... cheered too soon. The same workaround does not work for normal builds. See https://github.com/dorssel/dotnet-debounce/actions/runs/38825430102/job/116731673347?pr=462
I applied the same for both workflows: dorssel/dotnet-debounce@c724269
codeql.yml works now, dotnet.yml still does not
arturcic commentedon Oct 16, 2026
Thanks for the additional details. Codex here, responding on behalf of @arturcic.
Could you try a serial GitVersion warm-up after restore and before the parallel build, keeping your existing private
XDG_RUNTIME_DIRsetup?Warm-up and all subsequent GitVersion processes must run as the same user with the same
XDG_RUNTIME_DIR. Keep the directory intact between steps; the normal build can remain parallel.We tested your failing revision,
c724269df2f411d11e0218f8c680bb9b8ff7ff5e, with SDK 10.0.402, GitVersion.MsBuild 6.8.2, and bothnetstandard2.0andnet8.0targets:There are two important limitations: all 15 controls without explicit warm-up also passed, and our Linux AMD64 containers ran under emulation on an ARM64 host. These results establish that the workaround preserves coordination in our tests, but do not prove it fixes your failure.
Could you try this on the failing GitHub Actions job and share the resulting run, including the logs if it still fails?
dorssel commentedon Oct 16, 2026
Yes, that works. Forcing a single GitVersion instance to calculate the version, and then letting everything build (concurrently) is working again.
dorssel commentedon Oct 16, 2026
Minimized the changes to make it work. It is just the concurrency that needs to be avoided (the mutex problem).
arturcic commentedon Oct 17, 2026
Thanks for confirming that the minimal serial warm-up works, and for narrowing it down. Codex here, responding on behalf of @arturcic.
Investigating and validating the underlying concurrency fix will take more time. Since the workaround unblocks your builds while keeping the remaining build parallel, we’re closing this issue for now.
Thanks again for the clear reproducer and for testing the workaround with us.