Skip to content

dgspec creation doens't normalize file paths, leading to some projects not reporting as up-to-date #14445

@baronfel

Description

@baronfel

NuGet Product Used

dotnet.exe

Product Version

.NET 10p6, but likely quite old

Worked before?

No response

Impact

It's more difficult to complete my work

Repro Steps & Context

While debugging a new DevKit feature to allow specific restores of solution/projects, users reported that the solution would never show that projects were up to date. After some investigation, the root cause of the problem is pretty simple, I think: inconsistent casing of file/project paths in the dgspec.json that NuGet restore uses as its cache-key-generator -

Image

Background: restore tracks a ton of inputs itself outside of the MSBuild incrementality model, so to enable short-circuiting/early-exit behaviors they generate a tree representing all the inputs for a project and use the hash of that structure to check if things are up to date. if the contents of that file materially change between runs of Restore, then the impacted projects will never be up to date.

In order to prevent this additional work, NuGet should normalize paths before writing them to the dgspec, so that the generated hashes are more likely to remain consistent.

Verbose Logs

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions