Skip to content

Unpack into a scratch folder of the run's own, deleted when it ends - #87

Merged
Mpdreamz merged 1 commit into
mainfrom
scratch
Nov 14, 2026
Merged

Mpdreamz merged 1 commit into
mainfrom
scratch

Conversation

@Mpdreamz

Copy link
Copy Markdown
Contributor

What the tool unpacks and copies to compare now goes into $TMPDIR/assembly-differ/<run id>, which is deleted when the run ends. Downloads still go to NuGet's global packages folder, as dotnet restore does.

Prompt summary: Comparisons should download into temporary scratch folders, not leave things behind. Caching package downloads is fine and in line with what users expect, so only the unpacked copies move.

Why

Each package the NuGet providers compared was unpacked under $TMPDIR/differ/<provider>/<id>/<version>, and .nupkg inputs under $TMPDIR/differ/nupkg. Nothing ever removed them, so every package and version a machine had compared stayed on disk.

What

One folder per run

Scratch.Folder hands out folders under a run-specific root, which is created on first use. Program deletes the root when the command returns, whatever it returns. The NuGet, .nupkg and deprecated GitHub providers all unpack there. Setting ASSEMBLY_DIFFER_KEEP_SCRATCH keeps the folder and prints where it is.

Tests

ScratchTests runs the tool with TMPDIR pointed at a folder of the test's own: after the run it is empty, and with ASSEMBLY_DIFFER_KEEP_SCRATCH it holds the unpacked assembly. The report scrubber replaces run ids with {run}, so the one snapshot holding a path only changed its folder. After the whole suite, the shared temporary folder holds no scratch folder.

Verify

mise run test
ASSEMBLY_DIFFER_KEEP_SCRATCH=1 assembly-differ nuget Proc 0.13.0 0.14.0   # prints the folder it kept

🤖 Generated with Claude Code

@Mpdreamz Mpdreamz added the enhancement An existing capability improved (minor bump) label Nov 14, 2026
Every package the tool compared stayed unpacked under $TMPDIR/differ, one
folder per package and version, for good. Each run now unpacks and copies
into $TMPDIR/assembly-differ/<run id>, and deletes it when it ends;
ASSEMBLY_DIFFER_KEEP_SCRATCH keeps it for a look. Downloads still come from
NuGet's global packages folder.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Mpdreamz
Mpdreamz merged commit a6a87e8 into main Nov 14, 2026
6 checks passed
@Mpdreamz
Mpdreamz deleted the scratch branch November 14, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement An existing capability improved (minor bump)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant