How to debug "cycle detected in references"

I’ve made patches to unbreak haskellPackages.tensorflow:

This works fine on macOS.

Before turning this into a pull request, I’m trying to test on Linux, and am using the nixos/nix docker container. There, however,

nix-build '<nixpkgs>' -A haskellPackages.proto-lens-protoc_0_5_0_0

gives me:

checking for references to /tmp/nix-build-proto-lens-protoc- in /nix/store/ns5kcp2hgwhxj429n46v2x7nd3g5v5lr-proto-lens-protoc-
cycle detected in the references of '/nix/store/ns5kcp2hgwhxj429n46v2x7nd3g5v5lr-proto-lens-protoc-' from '/nix/store/wlyp3bc5ss6pxf234mv34wkyfsjjn5y3-proto-lens-protoc-'
error: build of '/nix/store/ljbx8iy14j8dr97p8ad8gjpzfakkkvq8-proto-lens-protoc-' failed

I’m clueless on how to debug this. Help would be super-appreciated!

1 Like

For what it is worth, I checked out and ran nix-build -A haskellPackages.proto-lens-protoc_0_5_0_0. It built fine. I didn’t see the error message you posted.

$ pwd
$ git rev-parse HEAD
$ nix-build -A haskellPackages.proto-lens-protoc_0_5_0_0

I’m on NixOS.

My guess is that your <nixpkgs> isn’t pointing to the right place?

edit: Also, I should add that I don’t have any idea what could actually be causing the error you posted. I don’t think I have seen that before.

If I had been able to reproduce the error, I was going to try to disable tests for all the proto-lens packages. But I don’t have a good idea of whether that would have helped.

Thanks for looking into this! (Belatedly, sorry!)

This turned out to depend on the version of Nix itself and the order of updating the Nix Docker image. Not enough to file a reasonable bug report, I’m afraid.