ipetkov / crane

A Nix library for building cargo projects. Never build twice thanks to incremental artifact caching.
https://crane.dev
MIT License
962 stars 92 forks source link

Breaking on new Nix version #660

Closed dpc closed 4 months ago

dpc commented 4 months ago

With nix 2.21.3 our CI started failing unable to vendor new cargo deps:

building '/nix/store/yq9yfzmf7nvyq4nbb29fwm4a9zrgzq7r-jsonrpsee-types-0.24.0.drv'...
building '/nix/store/v456bqs4n5ab1yg7nkis1j63468lzq52-jsonrpsee-wasm-client-0.24.0.drv'...
jsonrpsee-types> error checking the existence of https://tarballs.nixos.org/sha256/0feba38a9878d70ccccd2f54b534b15e861d6caa7911d59abfd3e0d8b4de091f:
jsonrpsee-types> curl: (6) Could not resolve host: tarballs.nixos.org
jsonrpsee-types> trying https://static.crates.io/crates/jsonrpsee-types/0.24.0/download
jsonrpsee-types>   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
jsonrpsee-types>                                  Dload  Upload   Total   Spent    Left  Speed
jsonrpsee-types>   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: static.crates.io
jsonrpsee-types> Warning: Problem : timeout. Will retry in 1 seconds. 3 retries left.
jsonrpsee-wasm-client> error checking the existence of https://tarballs.nixos.org/sha256/e0da29b570ad645e72c6098716719d2ef58d51a8eb0f084ac5e43a5763839542:
jsonrpsee-wasm-client> curl: (6) Could not resolve host: tarballs.nixos.org
jsonrpsee-wasm-client> trying https://static.crates.io/crates/jsonrpsee-wasm-client/0.24.0/download
jsonrpsee-wasm-client>   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
jsonrpsee-wasm-client>                                  Dload  Upload   Total   Spent    Left  Speed
jsonrpsee-wasm-client>   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: static.crates.io
jsonrpsee-wasm-client> Warning: Problem : timeout. Will retry in 1 seconds. 3 retries left.
jsonrpsee-types>   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: static.crates.io
jsonrpsee-types> Warning: Problem : timeout. Will retry in 2 seconds. 2 retries left.
jsonrpsee-wasm-client>   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: static.crates.io
jsonrpsee-wasm-client> Warning: Problem : timeout. Will retry in 2 seconds. 2 retries left.
jsonrpsee-types>   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: static.crates.io
jsonrpsee-types> Warning: Problem : timeout. Will retry in 4 seconds. 1 retries left.
jsonrpsee-wasm-client>   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: static.crates.io
jsonrpsee-wasm-client> Warning: Problem : timeout. Will retry in 4 seconds. 1 retries left.
jsonrpsee-types>   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: static.crates.io
jsonrpsee-types> error: cannot download jsonrpsee-types-0.24.0 from any mirror
error: builder for '/nix/store/yq9yfzmf7nvyq4nbb29fwm4a9zrgzq7r-jsonrpsee-types-0.24.0.drv' failed with exit code 1;
       last 14 log lines:
       > error checking the existence of https://tarballs.nixos.org/sha256/0feba38a9878d70ccccd2f54b534b15e861d6caa7911d59abfd3e0d8b4de091f:
       > curl: (6) Could not resolve host: tarballs.nixos.org
       >
       > trying https://static.crates.io/crates/jsonrpsee-types/0.24.0/download
       >   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
       >                                  Dload  Upload   Total   Spent    Left  Speed
       >   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: static.crates.io
       > Warning: Problem : timeout. Will retry in 1 seconds. 3 retries left.
       >   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: static.crates.io
       > Warning: Problem : timeout. Will retry in 2 seconds. 2 retries left.
       >   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: static.crates.io
       > Warning: Problem : timeout. Will retry in 4 seconds. 1 retries left.
       >   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: static.crates.io
       > error: cannot download jsonrpsee-types-0.24.0 from any mirror
       For full logs, run 'nix log /nix/store/yq9yfzmf7nvyq4nbb29fwm4a9zrgzq7r-jsonrpsee-types-0.24.0.drv'.

I suspect this is a Nix breakage as we've just upgraded our CI runners. Downgrading to 2.18 fixes the issue.

I don't expect this being immediately actionable, just wanted to notify. Chances are this is yet another Nix version breakage of which there were many in recent months.

ipetkov commented 4 months ago

Thanks for the report! Yes I have also experienced too much breakage on newer releases that I've taken to pinning my CI to use whatever is in nixpkgs-unstable (currently the 2.18.x series)...


curl: (6) Could not resolve host: static.crates.io

As for this particular issue it seems like it was a DNS/networking issue?

dpc commented 4 months ago

As for this particular issue it seems like it was a DNS/networking issue?

We have multiple runs of the CI, separated by hours with the same behavior. It was reported not long after I did nixos update on all NixOS CI workers. And it fixed itself immediately after I downgraded to the 2.18.x. I'm 99% sure it's something about Nix version. Possibly not even crane's issue, so reporting mostly as a datapoint.

ipetkov commented 4 months ago

Definitely recommend reporting it to the Nix repo directly in that case!

ipetkov commented 4 months ago

Going to close this as I don't think there is much we can do here; still recommend opening an issue about this upstream!