Skip to content

Derivation failing on Fedora #152

@AndreiCravtov

Description

@AndreiCravtov

Following the getting started instructions I installed Nix + direnv on Fedora (changed nix.conf to use flakes, etc, etc) and cloned the template repo. When opening the shell in the cloned template directory, the startup direnv Nix script fails with the following error message:

[2/0/1229 built] building perl-5.40.0 (configurePhase): Checking to see which flavor of getpgrp is in use...
error: builder for '/nix/store/34x4vb85kvhmp1hjs0r6r7gla5shd8sd-gmp-6.3.0.drv' failed with exit code 2;
       last 10 log lines:
       > libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_fat_redc_2 -O2 -pedantic -fomit-frame-pointer -m64 -c fat_redc_2.c  -fPIC -DPIC -o .libs/fat_redc_2.o
       > libtool: compile:  ../mpn/m4-ccas --m4=m4 gcc -c -DHAVE_CONFIG_H -I. -I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_x86_64_sublsh1_n -O2 -pedantic -fomit-frame-pointer -m64 -Wa,--noexecstack x86_64_sublsh1_n.asm  -fPIC -DPIC -o .libs/x86_64_sublsh1_n.o
       > ../libtool: line 1766: ../mpn/m4-ccas: cannot execute: required file not found
       > make[2]: *** [Makefile:768: x86_64_sublsh1_n.lo] Error 1
       > make[2]: Leaving directory '/build/gmp-6.3.0/mpn'
       > make[1]: *** [Makefile:998: all-recursive] Error 1
       > make[1]: Leaving directory '/build/gmp-6.3.0'
       > make: *** [Makefile:788: all] Error 2
       > /nix/store/iba98fr65lc4fk1yzp23cdwa2d6md8f7-bootstrap-stage-xgcc-stdenv-linux/setup: line 1812: pop_var_context: head of shell_variables not a function context
       > /nix/store/iba98fr65lc4fk1yzp23cdwa2d6md8f7-bootstrap-stage-xgcc-stdenv-linux/setup: line 1: pop_var_context: head of shell_variables not a function context
       For full logs, run 'nix log /nix/store/34x4vb85kvhmp1hjs0r6r7gla5shd8sd-gmp-6.3.0.drv'.
error: 1 dependencies of derivation '/nix/store/hnnqpznc9mdwn0h8r0rdp37qrdbn5ga1-xgcc-14-20241116.drv' failed to build
error: 1 dependencies of derivation '/nix/store/757qvkgvd2mgyp6fkaxxmmqddlmkz38j-bootstrap-stage2-gcc-wrapper-14-20241116.drv' failed to build
error: 1 dependencies of derivation '/nix/store/4asgd98mjhx56pkvkwc5397k7fzpb6nq-bootstrap-stage3-gcc-wrapper-14-20241116.drv' failed to build
error: 1 dependencies of derivation '/nix/store/6n6ydd20i4zmyz75ad8nrf5gdi3lgm4x-glibc-2.40-66.drv' failed to build
error: 1 dependencies of derivation '/nix/store/gk745fc0fsr0jw4gr35i73qbhqnppimi-stdenv-linux.drv' failed to build
error: 1 dependencies of derivation '/nix/store/www1kkq9qphwm0ffy6nl1djlr19ylnaw-stdenv-linux.drv' failed to build
error (ignored): error: cannot unlink '/tmp/nix-build-perl-5.40.0.drv-11': Directory not empty
error:
       … while calling the 'derivationStrict' builtin

         at /derivation-internal.nix:9:12:

            8|
            9|   strict = derivationStrict drvAttrs;
             |            ^
           10|

       … while evaluating derivation 'haskell-template'
         whose name attribute is located at /nix/store/7770rp8l36gr0ayj230ww1idjpl3rkwf-source/pkgs/stdenv/generic/make-derivation.nix:375:7

       … while evaluating attribute 'buildInputs' of derivation 'haskell-template'

         at /nix/store/7770rp8l36gr0ayj230ww1idjpl3rkwf-source/pkgs/stdenv/generic/make-derivation.nix:422:7:

          421|       depsHostHost                = elemAt (elemAt dependencies 1) 0;
          422|       buildInputs                 = elemAt (elemAt dependencies 1) 1;
             |       ^
          423|       depsTargetTarget            = elemAt (elemAt dependencies 2) 0;

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: 1 dependencies of derivation '/nix/store/vdkzdchbkdxqmsm1a2m240c10i14m8l1-cabal2nix-haskell-template.drv' failed to build

Similarly, running nix develop -i -c haskell-language-server in the cloned template directory also gives an error

error: builder for '/nix/store/34x4vb85kvhmp1hjs0r6r7gla5shd8sd-gmp-6.3.0.drv' failed with exit code 2;
       last 10 log lines:
       > make[2]: *** [Makefile:768: x86_64_submul_1.lo] Error 1
       > libtool: compile:  ../mpn/m4-ccas --m4=m4 gcc -c -DHAVE_CONFIG_H -I. -I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_x86_64_addlsh2_n -O2 -pedantic -fomit-frame-pointer -m64 -Wa,--noexecstack x86_64_addlsh2_n.asm  -fPIC -DPIC -o .libs/x86_64_addlsh2_n.o
       > ../libtool: line 1766: ../mpn/m4-ccas: cannot execute: required file not found
       > make[2]: *** [Makefile:768: x86_64_addlsh2_n.lo] Error 1
       > make[2]: Leaving directory '/build/gmp-6.3.0/mpn'
       > make[1]: *** [Makefile:998: all-recursive] Error 1
       > make[1]: Leaving directory '/build/gmp-6.3.0'
       > make: *** [Makefile:788: all] Error 2
       > /nix/store/iba98fr65lc4fk1yzp23cdwa2d6md8f7-bootstrap-stage-xgcc-stdenv-linux/setup: line 1812: pop_var_context: head of shell_variables not a function context
       > /nix/store/iba98fr65lc4fk1yzp23cdwa2d6md8f7-bootstrap-stage-xgcc-stdenv-linux/setup: line 1: pop_var_context: head of shell_variables not a function context
       For full logs, run 'nix log /nix/store/34x4vb85kvhmp1hjs0r6r7gla5shd8sd-gmp-6.3.0.drv'.
error: 1 dependencies of derivation '/nix/store/hnnqpznc9mdwn0h8r0rdp37qrdbn5ga1-xgcc-14-20241116.drv' failed to build
error: 1 dependencies of derivation '/nix/store/757qvkgvd2mgyp6fkaxxmmqddlmkz38j-bootstrap-stage2-gcc-wrapper-14-20241116.drv' failed to build
error: 1 dependencies of derivation '/nix/store/4asgd98mjhx56pkvkwc5397k7fzpb6nq-bootstrap-stage3-gcc-wrapper-14-20241116.drv' failed to build
error: 1 dependencies of derivation '/nix/store/6n6ydd20i4zmyz75ad8nrf5gdi3lgm4x-glibc-2.40-66.drv' failed to build
error: 1 dependencies of derivation '/nix/store/gk745fc0fsr0jw4gr35i73qbhqnppimi-stdenv-linux.drv' failed to build
error: 1 dependencies of derivation '/nix/store/www1kkq9qphwm0ffy6nl1djlr19ylnaw-stdenv-linux.drv' failed to build
error (ignored): error: cannot unlink '/tmp/nix-build-perl-5.40.0.drv-12': Directory not empty
error:
       … while calling the 'derivationStrict' builtin

         at /derivation-internal.nix:9:12:

            8|
            9|   strict = derivationStrict drvAttrs;
             |            ^
           10|

       … while evaluating derivation 'haskell-template'
         whose name attribute is located at /nix/store/7770rp8l36gr0ayj230ww1idjpl3rkwf-source/pkgs/stdenv/generic/make-derivation.nix:375:7

       … while evaluating attribute 'buildInputs' of derivation 'haskell-template'

         at /nix/store/7770rp8l36gr0ayj230ww1idjpl3rkwf-source/pkgs/stdenv/generic/make-derivation.nix:422:7:

          421|       depsHostHost                = elemAt (elemAt dependencies 1) 0;
          422|       buildInputs                 = elemAt (elemAt dependencies 1) 1;
             |       ^
          423|       depsTargetTarget            = elemAt (elemAt dependencies 2) 0;

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: 1 dependencies of derivation '/nix/store/vdkzdchbkdxqmsm1a2m240c10i14m8l1-cabal2nix-haskell-template.drv' failed to build

And then I deleted the cloned template directory, and tried instead using the command nix --accept-flake-config run github:juspay/omnix -- init github:srid/haskell-template -o ./myproject which again produced a simmilar error

error: builder for '/nix/store/hdj46vzb25a02y1a3dj68mq4z5y0axh9-gmp-6.3.0.drv' failed with exit code 2;
       last 10 log lines:
       > make[2]: *** [Makefile:768: x86_64_sublsh1_n.lo] Error 1
       > ../libtool: line 1766: ../mpn/m4-ccas: cannot execute: required file not found
       > make[2]: *** [Makefile:768: x86_64_submul_1.lo] Error 1
       > libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_fat_mullo_basecase -O2 -pedantic -fomit-frame-pointer -m64 -c fat_mullo_basecase.c  -fPIC -DPIC -o .libs/fat_mullo_basecase.o
       > make[2]: *** [Makefile:768: x86_64_addlsh1_n.lo] Error 1
       > make[2]: *** [Makefile:768: x86_64_rshift.lo] Error 1
       > make[2]: Leaving directory '/build/gmp-6.3.0/mpn'
       > make[1]: *** [Makefile:998: all-recursive] Error 1
       > make[1]: Leaving directory '/build/gmp-6.3.0'
       > make: *** [Makefile:788: all] Error 2
       For full logs, run 'nix log /nix/store/hdj46vzb25a02y1a3dj68mq4z5y0axh9-gmp-6.3.0.drv'.
error: 1 dependencies of derivation '/nix/store/v7sf66r2s69ffwj52pv8b2hbji05dx0f-xgcc-13.3.0.drv' failed to build
error: 1 dependencies of derivation '/nix/store/36608z2bkyxay0jcvdjdrqj0hwhp0959-bootstrap-stage2-gcc-wrapper-13.3.0.drv' failed to build
error: 1 dependencies of derivation '/nix/store/32clnslhy0xf7x95anmb574016gaiqph-bootstrap-stage3-gcc-wrapper-13.3.0.drv' failed to build
error: 1 dependencies of derivation '/nix/store/ca3ks9a7cahwg0rn27pz3hf1h60r16sc-glibc-2.39-52.drv' failed to build
error: 1 dependencies of derivation '/nix/store/6sn8q8ssw50vvski2mifkyl8fqjjhbzs-stdenv-linux.drv' failed to build
error: 1 dependencies of derivation '/nix/store/dn12i0sz5m4hix0lnn675kcs791dz3ja-stdenv-linux.drv' failed to build
error (ignored): error: cannot unlink '/tmp/nix-build-perl-5.38.2.drv-1': Directory not empty
error: 1 dependencies of derivation '/nix/store/vr6pwd801s75r32d4rd6g4xysx08r44i-omnix-cli-0.1.0.drv' failed to build

and the common denominator is that they all fail due to *gmp-6.3.0.drv derivation which is unable to find files?? I have no idea what that thing is, but my guess is that it has something to do with the GNU C compiler?

My guess so far is that, either:

  1. this repo wan't meant for Nix package manager generically, but specifically NixOS, so the build steps for some of the deep-nested dependencies are specified with respect to some NixOS-specific quirks, hence the build will fail on other distros?
  2. this is a Fedora+Nix-specific issue, I heard that because Fedora uses SELinux it has bad interactions with the Nix package manager and requires tweaking configs to resolve. Maybe this is related?
  3. there is an extra flag I need to pass when running these commands, since I am not using NixOS

Any help would be greatly appreciated

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions