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?
That's weird. Can you give me a pointer to a log?
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
this uses default.nix
via templates btw
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
The first thing I notice is that it is only on released versions (in nixpkgs), so likely not something to do with Cachix.
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.
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.
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
I just got the same error here: https://travis-ci.com/github/Zimmi48/corn/builds/168940729
ah, then it wasn't just some weird local event, and also not limited to travis dot org.
OK, this time, this is is NixOS/nixpkgs#89275
I've pushed a fix in the templates repository.
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.
Did you also introduce sandboxed builds at the same time?
nope, the only change was nix: 2.3.5
, but maybe this sets sandboxed builds by default?
Maybe. Can you try adding:
preConfigure = ''
patchShebangs configure
'';
to your default.nix
? It should likely fix your problem.
that did indeed fix the problem, thanks!
Last updated: Oct 13 2024 at 01:02 UTC