Repository navigation
Conversation
| { | ||
| if (_deterministic) | ||
| { | ||
| using (var hashFunc = new Sha512HashFunction()) |
There was a problem hiding this comment.
I agree, but that is what was available in NuGet.Packaging. If they jumped up from netstandard1.6 to netstandard2.0, the other crypto classes could be used.
There was a problem hiding this comment.
NuGet cross-targets net472 & netstandard2.0, but using the already available hash function one is enough.
|
Looks like a reasonable approach to me. |
|
How do I get CI to run for this? |
|
@nkolev92 Can you enable CI to run for this? |
|
@ctaggart I'm not sure if you can see the list of checks (I know you can't open the details link), but there are 2 end to end test failures, 72 mac failures, 80 windows unit test failures, and 335 windows functional test failures. All of the failures I looked at were new failures starting at your commit. I've been looking for a way to download the test results xml so you can check it yourself, but haven't found a way yet. Here's a small sample of the failures: NuGetExe_Caching_AllowsMissingPackageOnSource Most of the errors I saw were related to this Here's a different test failure: EnsureProjectFactoryWorksAsExpectedWithReferenceOutputAssemblyValuesComplex
EnsureProjectFactoryDoesNotAddFileThatIsAlreadyInPackage
If anyone knows how to download the test results xml files from Azure DevOps, I'll be happy to attach them here. |
@zivkan Flying blind here. Any change you can make the tests public? I am unauthorized: An alternative would be to commit a |
|
That's why I copy/pasted 3 of the failures here. From my looking around, I believe all the unit test failures to be caused from the You should be able to run the unit tests locally. By default if you run our |
|
Thanks @zivkan. Installing net 472 targeting pack and will run them in VS. |
|
@zivkan I can't actual build the |
|
@zivkan I fixed the GetHashBytes and all the |
|
I think our CI didn't successfully update GitHub Checks. When I look at the build, all Windows Functional Tests were green. The 1 failed test on EndToEnd has been failing for many builds, so unrelated to your change. Apex tests fail due to environment. So, I think it's all good now. |
|
What does it take to get this merged? Does it still need review by more people? |
|
@ctaggart We need some reviews(I am actually reviewing it now) and approval internally when some people are back from their vacation next week. |
|
I just had the thought that this has probably only added the feature into @nkolev92 Do we expect community contributors to make their contributions work with nuget.exe, pack targets and dotnet cli, or do we allow an "incomplete" implementation and we fill in the rest later? Do you know if we have to change |
nkolev92
left a comment
There was a problem hiding this comment.
This is a great start but it still needs some work.
NuGet.exe pack tests need to be added in:
The pack targets need to have the same support.
Entry points:
https://github.com/NuGet/NuGet.Client/blob/ea1a5fb2afe5149389bea7befb7c8a076f457274/src/NuGet.Core/NuGet.Build.Tasks.Pack/NuGet.Build.Tasks.Pack.targets
https://github.com/NuGet/NuGet.Client/blob/ea1a5fb2afe5149389bea7befb7c8a076f457274/src/NuGet.Core/NuGet.Build.Tasks.Pack/PackTask.cs
Once that's implemented, dotnet pack tests can be added in https://github.com/NuGet/NuGet.Client/blob/ea1a5fb2afe5149389bea7befb7c8a076f457274/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/PackCommandTests.cs.
| { | ||
| if (_deterministic) | ||
| { | ||
| using (var hashFunc = new Sha512HashFunction()) |
There was a problem hiding this comment.
NuGet cross-targets net472 & netstandard2.0, but using the already available hash function one is enough.
| var entry = package.CreateEntry(entryName, CompressionLevel.Optimal); | ||
| entry.LastWriteTime = lastWriteTime; | ||
| var entry = CreateEntry(package, entryName, CompressionLevel.Optimal); | ||
| if(!_deterministic) |
| private ZipArchiveEntry CreateEntry(ZipArchive package, string entryName, CompressionLevel compressionLevel) | ||
| { | ||
| var entry = package.CreateEntry(entryName, CompressionLevel.Optimal); | ||
| if (_deterministic) |
|
|
||
| private static string ToHexString(byte[] arr) | ||
| { | ||
| return BitConverter.ToString(arr).ToLower().Replace("-", ""); |
Yes, |
|
The pack targets should probably define something like |
Seems unnecessary to me. Either your build is deterministic or not. I don't see a point of having part of the build deterministic and other part (packaging) non-deterministic, or vice versa. Note that if the compiler does not produce deterministic DLL then your package won't be deterministic no matter what, as it already contains non-deterministic bits. |
|
First---thank you, Cameron, for taking this on. Deterministic packages will help the workflow here substantially. I pulled latest from ctaggart:deterministic, gave it a quick run here with determinism toggled on and ran into one issue with a CLI pack test. A forced ... which relates to limits documented here. The exception appears to be thrown by ZipArchiveEntry, referring to constants atop ZipHelper that match the documented limits. A quick change from 1970 -> 1980 and a retest resolved the issue. |
|
Yes, thanks @ctaggart - we'd love to make pack deterministic. design wise, i'd lean towards agreeing with @tmat and just be more deterministic, rather than have a switch. If that isn't a slam dunk, let's talk it through. |
|
Closing this in favor of #2989. |



For NuGet/Home#6229, following the notes in there. Additional tests should be added. I'd like to know of all existing ones pass, so I'm creating the PR.