Stream: Coq users

Topic: Nix CI hash error


view this post on Zulip Karl Palmskog (May 31 2020 at 17:23):

I started seeing errors like this with Travis using CI via Nix a few minutes ago:

$ nix-build --argstr coq-version-or-url "$COQ" --extra-substituters https://coq.cachix.org --trusted-public-keys "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= coq.cachix.org-1:5QW/wwEnD+l2jvN6QRbRRsa4hBHG3QiQQ26cxu1F5tI="

error: unknown hash algorithm '', at /nix/store/fhksmnm8dk9b1hs99sfzha4nwvpfs86n-nixpkgs-20.09pre227892.b27a19d5bf7/nixpkgs/pkgs/build-support/fetchurl/default.nix:119:3

Did something happen to cachix?

view this post on Zulip Théo Zimmermann (May 31 2020 at 17:25):

That's weird. Can you give me a pointer to a log?

view this post on Zulip Karl Palmskog (May 31 2020 at 17:26):

Good build: https://travis-ci.org/github/DistributedComponents/InfSeqExt/builds/693164017
Bad build of same code 2h later: https://travis-ci.org/github/DistributedComponents/InfSeqExt/builds/693189325

view this post on Zulip Karl Palmskog (May 31 2020 at 17:27):

this uses default.nix via templates btw

view this post on Zulip Karl Palmskog (May 31 2020 at 17:29):

note that that repo is stuck on travis.org which I can't change, but it's not obvious how this could be the culprit

view this post on Zulip Théo Zimmermann (May 31 2020 at 17:29):

The first thing I notice is that it is only on released versions (in nixpkgs), so likely not something to do with Cachix.

view this post on Zulip Théo Zimmermann (May 31 2020 at 17:34):

I thought this could have been a problem introduced in nixpkgs-unstable very recently, but https://status.nixos.org/ reports that this channel is 9 days old.

view this post on Zulip Karl Palmskog (May 31 2020 at 17:35):

I guess it could be a local problem of some sort (e.g., due to different Travis). I'll see if I can reproduce on some other project.

view this post on Zulip Théo Zimmermann (May 31 2020 at 17:37):

This is likely unrelated but you may try to activate sandbox builds as documented on the bottom of this page: https://nixos.wiki/wiki/Nix_on_Travis

view this post on Zulip Théo Zimmermann (Jun 01 2020 at 08:09):

I just got the same error here: https://travis-ci.com/github/Zimmi48/corn/builds/168940729

view this post on Zulip Karl Palmskog (Jun 01 2020 at 08:15):

ah, then it wasn't just some weird local event, and also not limited to travis dot org.

view this post on Zulip Théo Zimmermann (Jun 01 2020 at 11:24):

OK, this time, this is is NixOS/nixpkgs#89275

view this post on Zulip Théo Zimmermann (Jun 01 2020 at 12:14):

I've pushed a fix in the templates repository.

view this post on Zulip Karl Palmskog (Jun 02 2020 at 14:53):

ah, this seems to solve that particular problem but now it seems the behavior for executing scripts has changed, e.g., I had a small configure script in a project with #/usr/bin/env bash, but now I get:

/nix/store/b0jz23gnnyjrr72rz36xkc3wr36isky6-stdenv-linux/setup: ./configure: /usr/bin/env: bad interpreter: No such file or directory

which did not happen before.

view this post on Zulip Théo Zimmermann (Jun 02 2020 at 15:10):

Did you also introduce sandboxed builds at the same time?

view this post on Zulip Karl Palmskog (Jun 02 2020 at 15:17):

nope, the only change was nix: 2.3.5, but maybe this sets sandboxed builds by default?

view this post on Zulip Théo Zimmermann (Jun 02 2020 at 15:18):

Maybe. Can you try adding:

  preConfigure = ''
    patchShebangs configure
  '';

to your default.nix? It should likely fix your problem.

view this post on Zulip Karl Palmskog (Jun 02 2020 at 15:40):

that did indeed fix the problem, thanks!


Last updated: Jan 27 2023 at 01:03 UTC