Skip to content

Use the binary dotnet SDK in Darwin dev shells#1723

Merged
chavic merged 3 commits into
payjoin:masterfrom
chavic:chavic/csharp-devshell-binary-dotnet
Jul 9, 2026
Merged

Use the binary dotnet SDK in Darwin dev shells#1723
chavic merged 3 commits into
payjoin:masterfrom
chavic:chavic/csharp-devshell-binary-dotnet

Conversation

@chavic

@chavic chavic commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

The "Build and test csharp (macos-latest)" job takes 2.5–3 hours on every run (2h51m, 2h53m, 2h29m on the three most recent PRs, and the same ~150–170 min on every earlier csharp.yml run sampled back through July 4). The job log shows where the time goes: of a 2h29m run, the script itself, cargo build, bindings generation, dotnet test, finishes in under five minutes (4m09s + 2s + 8s); the remaining ~2h24m is nix develop .#csharp building dotnet-vmr derivations before the command even starts.

dotnetCorePackages.sdk_10_0 resolves to the source-built VMR SDK, and the public nix cache has no Darwin binaries for it, so every macOS CI run, and every macOS contributor's first nix develop .#csharp, compiles the entire .NET SDK from source.

This switches the Darwin dev shells to the Microsoft-binary SDK, sdk_10_0_1xx-bin: the same 10.0.1xx feature band that global.json requires (10.0.100, rollForward: latestFeature), and the same share/dotnet layout that DOTNET_ROOT expects. Linux keeps the source-built SDK, which hydra serves from cache. After the change, the Darwin csharp shell's closure contains the dotnet-sdk-10.0.109-osx-arm64 binary tarball and no VMR derivations.

Disclosure: co-authored by Claude Code

Pull Request Checklist

Please confirm the following before requesting review:

The csharp dev shell takes dotnetCorePackages.sdk_10_0, which
resolves to the source-built VMR SDK. The public nix cache has no
Darwin binaries for the VMR, so every uncached realization compiles
the entire .NET SDK from source. On CI this dominates the macOS
csharp job: of a 2h29m run, nix develop spent 2h24m building
dotnet-vmr derivations while the actual work took under five
minutes (cargo build 4m09s, bindings generation 2s, dotnet test
8s). macOS contributors pay the same cost on their first
nix develop .#csharp.

Use the Microsoft-binary SDK on Darwin instead; it satisfies the
same global.json band (10.0.1xx) and keeps the share/dotnet layout
DOTNET_ROOT expects. Linux keeps the source-built SDK, which hydra
serves from cache.
The unix csharp jobs run inside the flake's csharp dev shell, so a
flake change alters this workflow's environment without running it.
Include the flake in the path filter; it also lets this branch's
dev shell change demonstrate its effect on the macOS job time.
@chavic

chavic commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

Pushed a second commit adding flake.nix/flake.lock to the csharp workflow's path filter: the unix jobs run inside the flake's csharp dev shell, so flake changes alter this workflow's environment without triggering it, which also meant this PR couldn't demonstrate its own effect. The macOS job time on this PR is now the measurement: previously ~150–170 min, expected in the ~10–15 min range with the binary SDK.

@chavic chavic requested a review from benalleng July 9, 2026 19:20
The dart, javascript and python jobs run inside flake dev shells,
same as csharp: a flake change alters their environment without
running them. Give them the same flake path filter.
@chavic

chavic commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

Extended the path-filter fix to the dart, javascript and python workflows in the last commit, they run inside flake dev shells the same way, so they had the same blind spot. Their runs on this PR also serve as confirmation that the Darwin SDK change doesn't disturb the other shells.

@coveralls

coveralls commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 29044042286

Coverage remained the same at 86.003%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 15660
Covered Lines: 13468
Line Coverage: 86.0%
Coverage Strength: 348.35 hits per line

💛 - Coveralls

@chavic

chavic commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

Measurement is in: Build and test csharp (macos-latest) now passes in 12m12s on this PR, versus ~150–170 min on every prior run of the workflow, with no dotnet-vmr derivations built. Ubuntu is unchanged at 31m20s, as expected since the Linux shell keeps the source-built SDK. dart/javascript/python runs on this PR confirm the flake change is inert for the other shells.

@benalleng benalleng left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ACK 1d8fe17
This substantially reduces the build time of the macos dev shell

@chavic chavic merged commit 447c859 into payjoin:master Jul 9, 2026
22 checks passed

@Mshehu5 Mshehu5 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.

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.

4 participants