-
-
Notifications
You must be signed in to change notification settings - Fork 15k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dotnet restore fails when building a package with dotnet lockfiles #347310
Comments
For me restore fails, but with a different error |
@anpin Interesting, I recently updated another dotnet app, regenerated deps.nix, and it builds without any issues. Can you share some details how you got that error? |
@gepbird here you go
Cli> Running phase: unpackPhase
Cli> unpacking source archive /nix/store/s1891z4fd3x0kanaz73dw8pfvpricq9j-Cli
Cli> source root is Cli
Cli> Running phase: patchPhase
Cli> Running phase: configureNuget
Cli> The template "NuGet Config" was created successfully.
Cli> Processing post-creation actions...
Cli> Running phase: updateAutotoolsGnuConfigScriptsPhase
Cli> Running phase: configurePhase
Cli> Executing dotnetConfigureHook
Cli> Determining projects to restore...
Cli> /build/Cli/Cli.fsproj : error NU1403: Package content hash validation failed for Argu.6.2.4. The package is different than the last restore.
Cli> /build/Cli/Cli.fsproj : error NU1403: Package content hash validation failed for MessagePack.Annotations.2.5.172. The package is different than the last restore.
Cli> /build/Cli/Cli.fsproj : error NU1403: Package content hash validation failed for System.Configuration.ConfigurationManager.4.4.0. The package is different than the last restore.
Cli> /build/Cli/Cli.fsproj : error NU1403: Package content hash validation failed for System.Security.Cryptography.ProtectedData.4.4.0. The package is different than the last restore.
Cli> /build/Cli/Cli.fsproj : error NU1403:
Cli> Failed to restore /build/Cli/Cli.fsproj (in 366 ms).
error: builder for '/nix/store/z1brbiayrw9c2gzi5d55jsrshr7fk292-Cli-0.0.1.drv' failed with exit code 1;
last 10 log lines:
> Running phase: updateAutotoolsGnuConfigScriptsPhase
> Running phase: configurePhase
> Executing dotnetConfigureHook
> Determining projects to restore...
> /build/Cli/Cli.fsproj : error NU1403: Package content hash validation failed for Argu.6.2.4. The package is different than the last restore.
> /build/Cli/Cli.fsproj : error NU1403: Package content hash validation failed for MessagePack.Annotations.2.5.172. The package is different than the last restore.
> /build/Cli/Cli.fsproj : error NU1403: Package content hash validation failed for System.Configuration.ConfigurationManager.4.4.0. The package is different than the last restore.
> /build/Cli/Cli.fsproj : error NU1403: Package content hash validation failed for System.Security.Cryptography.ProtectedData.4.4.0. The package is different than the last restore.
> /build/Cli/Cli.fsproj : error NU1403:
> Failed to restore /build/Cli/Cli.fsproj (in 366 ms).
For full logs, run 'nix log /nix/store/z1brbiayrw9c2gzi5d55jsrshr7fk292-Cli-0.0.1.drv'. |
@anpin big thanks for the reproduction repo, I see your error. However it is caused by a different PR: #343837 (2c97d67) To reproduce it on the first bad commit: Going back one nixpkgs commit, that error message changes: The "File exists" error was introduced in the same commit where I have this issue, d3ca502. To reproduce it you need to run |
On latest, I had to add After doing that, I can successfully build the project, but only if I remove It makes sense that package validation could fail when packages are patched by nixpkgs, but 'Argu' doesn't seem to have any (substantial) differences. For reference, this is what's in project.assets.json after make-deps:
and in the build:
|
nuget-packageslock2nix utilizes dotnet's
packages.lock.json
to resolve dependencies rather than using adeps.nix
file.Describe the bug
After #327651, the example project doesn't build with the error message:
error NU1101: Unable to find package <YOUR_PACKAGE>. No packages exist with this id in source(s): _nix
Steps To Reproduce
Build nuget-packageslock2nix's example project using a version of nixpkgs where the issue is present (also update the flake itself to avoid an unrelated issue):
nix build 'github:mdarocha/nuget-packageslock2nix?dir=example' --override-input nixpkgs github:NixOS/nixpkgs/d3ca5027fabc6f3c8df7849fcbb7afaa3903c17b --override-input nuget-packageslock2nix github:mdarocha/nuget-packageslock2nix
Expected behavior
The example project builds, just like using a one commit older nixpkgs:
nix build 'github:mdarocha/nuget-packageslock2nix?dir=example' --override-input nixpkgs github:NixOS/nixpkgs/7402aa90cff52a03f14e680346fa4038a1e17e93 --override-input nuget-packageslock2nix github:mdarocha/nuget-packageslock2nix
Additional context
Full build log: https://gist.github.com/gepbird/421dafce0f63854cc834b18ee056de27
Notify maintainers
@corngood
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.Add a 👍 reaction to issues you find important.
The text was updated successfully, but these errors were encountered: