Skip to content

Re-enable support for deterministic pack - #7020

Merged
zivkan merged 1 commit into
NuGet:devfrom
omajid:deterministic-pack-nuspec-file
May 12, 2026
Merged

zivkan merged 1 commit into
NuGet:devfrom
omajid:deterministic-pack-nuspec-file

Conversation

@omajid

@omajid omajid commented Dec 29, 2025 •

Copy link
Copy Markdown
Contributor

Bug

Fixes: NuGet/Home#8601

Description

Re-enable support for deterministic pack

Make NuGet pack more determinisitic, by default.

This makes Deterministic property (default = true) work again for nuget pack via msbuild.

It adds support for DeterministicTimestamp property (default = true) too.

For more details about the properties and the design goals, see:

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.

@dotnet-policy-service dotnet-policy-service Bot added the Community PRs created by someone not in the NuGet team label Dec 29, 2025
@omajid
omajid force-pushed the deterministic-pack-nuspec-file branch 5 times, most recently from aa6ce30 to 50b60af Compare December 29, 2025 23:25
@dotnet-policy-service dotnet-policy-service Bot added the Status:No recent activity PRs that have not had any recent activity and will be closed if the label is not removed label Jan 6, 2026
@omajid
omajid force-pushed the deterministic-pack-nuspec-file branch from 50b60af to 1ca6cc7 Compare January 31, 2026 13:51
@dotnet-policy-service dotnet-policy-service Bot removed the Status:No recent activity PRs that have not had any recent activity and will be closed if the label is not removed label Jan 31, 2026
@omajid
omajid force-pushed the deterministic-pack-nuspec-file branch 3 times, most recently from 00711c7 to 57cd90d Compare February 9, 2026 14:31
@dotnet-policy-service dotnet-policy-service Bot added the Status:No recent activity PRs that have not had any recent activity and will be closed if the label is not removed label Feb 16, 2026
@omajid
omajid force-pushed the deterministic-pack-nuspec-file branch from 57cd90d to eda2ff0 Compare February 24, 2026 15:50
@dotnet-policy-service dotnet-policy-service Bot removed the Status:No recent activity PRs that have not had any recent activity and will be closed if the label is not removed label Feb 24, 2026
@omajid
omajid force-pushed the deterministic-pack-nuspec-file branch 7 times, most recently from e1e6e37 to 8e626f9 Compare February 27, 2026 12:04
@omajid
omajid marked this pull request as ready for review February 27, 2026 12:05
@omajid
omajid requested a review from a team as a code owner February 27, 2026 12:05
@omajid
omajid force-pushed the deterministic-pack-nuspec-file branch 2 times, most recently from 40760dc to 4ec6faa Compare May 1, 2026 14:39
@omajid

omajid commented May 4, 2026

Copy link
Copy Markdown
Contributor Author

I can't tell if the CI failure is related or not.

@zivkan zivkan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As mentioned, one of the assemblies still has changes in the Shipped instead of the Unshipped txt file, and just three other small changes, then I think it's good to merge.

@omajid
omajid force-pushed the deterministic-pack-nuspec-file branch from 4ec6faa to 8112b29 Compare May 7, 2026 15:46
akoeplinger
akoeplinger previously approved these changes May 8, 2026
Make NuGet pack more determinisitic, by default.

This makes `Deterministic` property (default = `true`) work again for
nuget pack via msbuild.

It adds support for `DeterministicTimestamp` property (default = `true`)
too.

For more details about the properties and the design goals, see:

- NuGet/Home#14785
- https://github.com/NuGet/Home/main/accepted/2026/deterministic-pack-revisited.md

Fixes: NuGet/Home#8601
@omajid
omajid force-pushed the deterministic-pack-nuspec-file branch from 8112b29 to ad33f3c Compare May 11, 2026 13:28
@akoeplinger
akoeplinger requested a review from nkolev92 May 12, 2026 13:43
@zivkan
zivkan merged commit 339a38c into NuGet:dev May 12, 2026
17 checks passed
@omajid

omajid commented May 13, 2026

Copy link
Copy Markdown
Contributor Author

Thanks, everyone, for working through this with me!

@mmitche

mmitche commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

I think this causes a bootstrap failure in the VMR, in signing:
The root cause may be the following:

There is a missing disposal here. The pack task is running inside of the dotnet host process, which is then holding onto the file handle.

@nkolev92

Copy link
Copy Markdown
Member

Tracking issue created: NuGet/Home#14959. The root cause is a missing stream disposal in PackageBuilder.CalcPsmdcpName (deterministic path) — file.GetStream() opens a file handle via File.OpenRead that ReadAllBytes never disposes, leaking handles held by the dotnet host process and causing the signing/copy failure in the VMR.

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.

Revisit deterministic pack

6 participants