Skip to content

Make PackageBuilder.CalcPsmdcpName deterministic - #7410

Merged
zivkan merged 1 commit into
NuGet:devfrom
omajid:deterministic-packagebuilder-psmdcpname
Jun 10, 2026
Merged

zivkan merged 1 commit into
NuGet:devfrom
omajid:deterministic-packagebuilder-psmdcpname

Conversation

@omajid

@omajid omajid commented May 23, 2026 •

Copy link
Copy Markdown
Contributor

Bug

Fixes: NuGet/Home#14916

Description

The order of input files can vary between nuget pack runs, specially if nuspec files use the ** glob when specifying <file> elements.

A simple workaround is to sort files before computing the hash of the file contents in nuget package for the psmdcp file name. This keeps the hash stable across nuget pack runs.

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc.

@omajid
omajid requested a review from a team as a code owner May 23, 2026 21:07
@omajid
omajid requested review from martinrrm and nkolev92 May 23, 2026 21:07
@dotnet-policy-service dotnet-policy-service Bot added the Community PRs created by someone not in the NuGet team label May 23, 2026
@johnny1494

Copy link
Copy Markdown

Bug

Fixes: NuGet/Home#14916

Description

The order of input files can vary between nuget pack runs, specially if nuspec files use the ** glob when specifying <file> elements.

A simple workaround is to sort files before computing the hash of the file contents in nuget package for the psmdcp file name. This keeps the hash stable across nuget pack runs.

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests buscar órdenes
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc.
    Rastrear mejor pagos en las órdenes de Instacar shopper
    Órdenes de de $40-50-60-70 oh más altas en órdenes

@omajid

omajid commented May 25, 2026

Copy link
Copy Markdown
Contributor Author

Alternatively, we can try and fix the nuspec glob-resolving code at

public static IEnumerable<SearchPathResult> PerformWildcardSearch(
to return in a deterministic order.

@Nigusu-Allehu Nigusu-Allehu self-assigned this May 28, 2026
@omajid
omajid force-pushed the deterministic-packagebuilder-psmdcpname branch from d031db4 to 88533da Compare June 2, 2026 03:10
@omajid
omajid marked this pull request as draft June 2, 2026 03:11
@omajid
omajid force-pushed the deterministic-packagebuilder-psmdcpname branch 10 times, most recently from 04d0658 to 4c5d050 Compare June 5, 2026 15:27
@omajid
omajid force-pushed the deterministic-packagebuilder-psmdcpname branch 4 times, most recently from 2f7d5b1 to 8453bb0 Compare June 8, 2026 18:50
The order of input files can vary between nuget pack runs, specially if
nuspec files use the `**` glob when specifying `<file>` elements.

A simple workaround is to sort files before computing the hash of the
file contents in nuget package for the psmdcp file name. This keeps the
hash stable across nuget pack runs.

Fixes: NuGet/Home#14916
@omajid
omajid force-pushed the deterministic-packagebuilder-psmdcpname branch from 8453bb0 to d43c96d Compare June 8, 2026 21:10
@omajid
omajid marked this pull request as ready for review June 9, 2026 02:25
@Nigusu-Allehu
Nigusu-Allehu self-requested a review June 9, 2026 23:38
nkolev92
nkolev92 approved these changes Jun 9, 2026 •
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Community PRs created by someone not in the NuGet team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use a deterministic order for files when calculating psmdcp hash

5 participants