Skip to content

Set a valid temporary directory for .NET on CI - #13136

Merged
jonathanpeppers merged 3 commits into
mainfrom
simonrozsival-investigate-ci-build-1634232
Oct 14, 2026
Merged

jonathanpeppers merged 3 commits into
mainfrom
simonrozsival-investigate-ci-build-1634232

Conversation

@simonrozsival

@simonrozsival simonrozsival commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Summary

Set TMPDIR to $(Agent.TempDirectory) in the shared pipeline variables.

.NET 10.0.13 / SDK 10.0.402 changed Unix named mutexes to use user-scoped storage. On the shared macOS agents, TMPDIR is present as an empty string, which causes the runtime to validate an empty path and fail before NuGet can create its NuGet-Migrations mutex:

lstat("", ...) == -1; errno == ENOENT

Using the Azure agent's existing per-job temporary directory gives the runtime a valid, private location. This is a one-line effective pipeline change; the earlier NuGet-specific marker workaround was removed. No SDK downgrade or source change is involved.

Validation

  • git diff --check — passed
  • YAML parsing of the affected templates — passed
  • Previous build 1634778: Android-tools macOS and main macOS initialization/build passed with the marker workaround
  • Build 1634782: main macOS build passed; later macOS MSBuild tests still failed because the workaround did not apply globally
  • New validation with TMPDIR=$(Agent.TempDirectory) — pending

Follow-up

Remove this workaround when the hosted macOS image supplies a valid TMPDIR or the runtime servicing guidance changes.

@simonrozsival simonrozsival changed the title [Investigation] Work around macOS NuGet migration mutex failures Work around macOS NuGet migration mutex failures Oct 14, 2026
@simonrozsival
simonrozsival marked this pull request as ready for review October 14, 2026 09:39
Copilot AI balanced review requested due to automatic review settings October 14, 2026 09:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The workaround is technically sound, but final main macOS validation was still running and its cleanup dependency is not tracked.

1 open finding
What changed in this PR

Introduces a macOS CI workaround that bypasses NuGet’s failing first-run migration mutex.

Changes:

  • Creates isolated NuGet migration state under the agent temporary directory.
  • Applies it to main macOS builds and Android-tools macOS tests.
  • Leaves Windows and Linux jobs unchanged.
File Description
initialize-nuget-migrations.yaml Creates the marker and exports XDG_DATA_HOME.
build-macos-steps.yaml Initializes NuGet before macOS build steps.
stage-xamarin-android-tools-tests.yaml Applies initialization to macOS tooling tests.

🧠 Review effort: Balanced

Comment on lines +125 to +126
# Temporary workaround for NuGet's first-run migration mutex failures on
# shared macOS agents. The migration marker avoids creating NuGet-Migrations.
@simonrozsival simonrozsival changed the title Work around macOS NuGet migration mutex failures Set a valid temporary directory for .NET on CI Oct 14, 2026
@jonathanpeppers
jonathanpeppers merged commit 347bedc into main Oct 14, 2026
41 checks passed
@jonathanpeppers
jonathanpeppers deleted the simonrozsival-investigate-ci-build-1634232 branch October 14, 2026 12:57
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants