Skip to content

A second run of a consumer script finds no dotnet-ef: the SDK's tool cache names the first run's deleted folder #175

Done

Description

@CaffeinatedCoder

Problem

spikes/B.DesignTime/run.sh failed every dotnet ef path on 2026-11-24, on a machine where test/ConsumerSmokeTest/run.sh had run with SMOKE_EF_VERSION=11.0.0 ten days earlier (#143). Each log holds one line, the SDK's request to run dotnet tool restore.

The scripts restore packages into a folder of their own (NUGET_PACKAGES=$work/packages) and install dotnet-ef there as a local tool. The SDK records where a tool's files are in ~/.dotnet/toolResolverCache, by tool and version, outside that folder. The entry for dotnet-ef 11.0.0 named the smoke test's work folder, which is deleted when the run ends:

{"Version":"11.0.0", … "PathToExecutable":"/private/var/folders/…/schemakit-smoke.FiA2LM/packages/dotnet-ef/11.0.0/tools/net10.0/any/dotnet-ef.dll"}

dotnet tool install and dotnet tool restore in the new work folder both succeed and leave the entry as it is, and dotnet ef then finds no file. With DOTNET_CLI_HOME pointed at a folder of the run, the same dotnet ef --version answers 11.0.0.

A runner in CI is new for every job, so this shows on a developer's machine only, and only from the second run with one version of the tool. It reports a wiring that works as broken: 40 paths of spike B failed, none of them for a reason in EF Core or in the spike. Found while measuring #174.

A second cause, in spike B alone

With the tool found, 12 paths of spike B still failed: every one that starts the built app, with "The library 'libhostpolicy.dylib' required to execute the application was not found".

On macOS mktemp -d answers /var/folders/…, which is a symbolic link to /private/var/folders/…. Spike B kept that spelling (pwd); dotnet ef 11.0.0 builds the project under the resolved one. The file list of the build then holds Consumer.deps.json and Consumer.runtimeconfig.json under both spellings, and the script's next dotnet build, under the link, takes the other spelling's entries for files of an earlier build that this one no longer writes: IncrementalClean deletes them (-v:diag shows both deletions). Measured in the work folder: build, build, dotnet ef migrations list, build leaves 2, 2, 2, 0 of the two files, every time.

Spike D and the consumer smoke test already resolve their work folder with pwd -P.

Change

  • Each script that installs dotnet-ef into its work folder (spikes/B.DesignTime/run.sh, spikes/D.ScriptsAndBundles/run.sh, test/ConsumerSmokeTest/run.sh) gives the run a DOTNET_CLI_HOME in that folder, beside NUGET_PACKAGES, so that nothing a run records outlives its folder.
  • Spike B resolves its work folder with pwd -P, as the other two do.

Done when

Spike B passes twice in a row on one machine, each run in a work folder of its own.

Activity

  1. added this to the 11.0.0 milestone on Nov 24, 2026
  2. added
    bug
    severity/low
    area/release
    on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/releasebugseverity/low

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions