NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.45k stars 13.65k forks source link

sauerbraten-r5000: installation fails on NixOS 18.03 #45088

Closed alexeymuranov closed 4 years ago

alexeymuranov commented 6 years ago

Issue description

I tried to reinstall sauerbraten-r5000 on NixOS 18.03, but the installation failed with the following messages:

replacing old 'sauerbraten-r5000'
installing 'sauerbraten-r5000'
these derivations will be built:
  /nix/store/pw47n9hr1xzrgz36z44ng833c85ak64c-sauerbraten-r5000.drv
building '/nix/store/pw47n9hr1xzrgz36z44ng833c85ak64c-sauerbraten-r5000.drv'...
unpacking sources
unpacking source archive /nix/store/zv70sdfqmazcwd58c0p8y54as7zv4l5p-code-r5000
source root is code-r5000
patching sources
configuring
no configure script, doing nothing
building
/tmp/nix-build-sauerbraten-r5000.drv-0/code-r5000/src /tmp/nix-build-sauerbraten-r5000.drv-0/code-r5000
build flags: SHELL=/nix/store/lw7xaqhakk0i1c631m3cvac3x4lc5gr5-bash-4.4-p12/bin/bash
make -C enet CC='gcc' AR='ar'
make[1]: Entering directory '/tmp/nix-build-sauerbraten-r5000.drv-0/code-r5000/src/enet'
gcc -O3 -fomit-frame-pointer -Iinclude  -DHAS_GETHOSTBYADDR_R -DHAS_GETHOSTBYNAME_R -DHAS_POLL -DHAS_FCNTL -DHAS_INET_PTON -DHAS_INET_NTOP -DHAS_MSGHDR_FLAGS -DHAS_SOCKLEN_T   -c -o callbacks.o callbacks.c
gcc -O3 -fomit-frame-pointer -Iinclude  -DHAS_GETHOSTBYADDR_R -DHAS_GETHOSTBYNAME_R -DHAS_POLL -DHAS_FCNTL -DHAS_INET_PTON -DHAS_INET_NTOP -DHAS_MSGHDR_FLAGS -DHAS_SOCKLEN_T   -c -o compress.o compress.c
gcc -O3 -fomit-frame-pointer -Iinclude  -DHAS_GETHOSTBYADDR_R -DHAS_GETHOSTBYNAME_R -DHAS_POLL -DHAS_FCNTL -DHAS_INET_PTON -DHAS_INET_NTOP -DHAS_MSGHDR_FLAGS -DHAS_SOCKLEN_T   -c -o host.o host.c
gcc -O3 -fomit-frame-pointer -Iinclude  -DHAS_GETHOSTBYADDR_R -DHAS_GETHOSTBYNAME_R -DHAS_POLL -DHAS_FCNTL -DHAS_INET_PTON -DHAS_INET_NTOP -DHAS_MSGHDR_FLAGS -DHAS_SOCKLEN_T   -c -o list.o list.c
gcc -O3 -fomit-frame-pointer -Iinclude  -DHAS_GETHOSTBYADDR_R -DHAS_GETHOSTBYNAME_R -DHAS_POLL -DHAS_FCNTL -DHAS_INET_PTON -DHAS_INET_NTOP -DHAS_MSGHDR_FLAGS -DHAS_SOCKLEN_T   -c -o packet.o packet.c
gcc -O3 -fomit-frame-pointer -Iinclude  -DHAS_GETHOSTBYADDR_R -DHAS_GETHOSTBYNAME_R -DHAS_POLL -DHAS_FCNTL -DHAS_INET_PTON -DHAS_INET_NTOP -DHAS_MSGHDR_FLAGS -DHAS_SOCKLEN_T   -c -o peer.o peer.c
gcc -O3 -fomit-frame-pointer -Iinclude  -DHAS_GETHOSTBYADDR_R -DHAS_GETHOSTBYNAME_R -DHAS_POLL -DHAS_FCNTL -DHAS_INET_PTON -DHAS_INET_NTOP -DHAS_MSGHDR_FLAGS -DHAS_SOCKLEN_T   -c -o protocol.o protocol.c
gcc -O3 -fomit-frame-pointer -Iinclude  -DHAS_GETHOSTBYADDR_R -DHAS_GETHOSTBYNAME_R -DHAS_POLL -DHAS_FCNTL -DHAS_INET_PTON -DHAS_INET_NTOP -DHAS_MSGHDR_FLAGS -DHAS_SOCKLEN_T   -c -o unix.o unix.c
gcc -O3 -fomit-frame-pointer -Iinclude  -DHAS_GETHOSTBYADDR_R -DHAS_GETHOSTBYNAME_R -DHAS_POLL -DHAS_FCNTL -DHAS_INET_PTON -DHAS_INET_NTOP -DHAS_MSGHDR_FLAGS -DHAS_SOCKLEN_T   -c -o win32.o win32.c
ar rcs libenet.a callbacks.o compress.o host.o list.o packet.o peer.o protocol.o unix.o win32.o
make[1]: Leaving directory '/tmp/nix-build-sauerbraten-r5000.drv-0/code-r5000/src/enet'
g++ -O3 -fomit-frame-pointer -ffast-math -Wall -fsigned-char -fno-exceptions -fno-rtti -Ishared -Iengine -Ifpsgame -Ienet/include -I/usr/X11R6/include `sdl-config --cflags` -x c++-header -o shared/cube.h.gch.tmp shared/cube.h
In file included from /nix/store/8hagj3k5q9vkyxnrl8431r4kpn4gf46l-glibc-2.26-131-dev/include/math.h:724:0,
                 from /nix/store/czxcii58v6d3yhrq9r667zw91192rcgk-gcc-7.3.0/include/c++/7.3.0/cmath:45,
                 from /nix/store/czxcii58v6d3yhrq9r667zw91192rcgk-gcc-7.3.0/include/c++/7.3.0/math.h:36,
                 from shared/cube.h:13:
/nix/store/8hagj3k5q9vkyxnrl8431r4kpn4gf46l-glibc-2.26-131-dev/include/bits/math-finite.h: In function 'double tgamma(double)':
/nix/store/8hagj3k5q9vkyxnrl8431r4kpn4gf46l-glibc-2.26-131-dev/include/bits/math-finite.h:203:21: error: '____gamma_r_finite' was not declared in this scope
   _Mdouble_ __res = __REDIRTO (gamma, _r, _MSUF_) (__d, &__local_signgam);
                     ^
/nix/store/8hagj3k5q9vkyxnrl8431r4kpn4gf46l-glibc-2.26-131-dev/include/bits/math-finite.h:203:21: note: suggested alternative: '__gamma_r_finite'
In file included from /nix/store/8hagj3k5q9vkyxnrl8431r4kpn4gf46l-glibc-2.26-131-dev/include/math.h:741:0,
                 from /nix/store/czxcii58v6d3yhrq9r667zw91192rcgk-gcc-7.3.0/include/c++/7.3.0/cmath:45,
                 from /nix/store/czxcii58v6d3yhrq9r667zw91192rcgk-gcc-7.3.0/include/c++/7.3.0/math.h:36,
                 from shared/cube.h:13:
/nix/store/8hagj3k5q9vkyxnrl8431r4kpn4gf46l-glibc-2.26-131-dev/include/bits/math-finite.h: In function 'float tgammaf(float)':
/nix/store/8hagj3k5q9vkyxnrl8431r4kpn4gf46l-glibc-2.26-131-dev/include/bits/math-finite.h:203:21: error: '____gammaf_r_finite' was not declared in this scope
   _Mdouble_ __res = __REDIRTO (gamma, _r, _MSUF_) (__d, &__local_signgam);
                     ^
/nix/store/8hagj3k5q9vkyxnrl8431r4kpn4gf46l-glibc-2.26-131-dev/include/bits/math-finite.h:203:21: note: suggested alternative: '__gammaf_r_finite'
In file included from /nix/store/8hagj3k5q9vkyxnrl8431r4kpn4gf46l-glibc-2.26-131-dev/include/math.h:755:0,
                 from /nix/store/czxcii58v6d3yhrq9r667zw91192rcgk-gcc-7.3.0/include/c++/7.3.0/cmath:45,
                 from /nix/store/czxcii58v6d3yhrq9r667zw91192rcgk-gcc-7.3.0/include/c++/7.3.0/math.h:36,
                 from shared/cube.h:13:
/nix/store/8hagj3k5q9vkyxnrl8431r4kpn4gf46l-glibc-2.26-131-dev/include/bits/math-finite.h: In function 'long double tgammal(long double)':
/nix/store/8hagj3k5q9vkyxnrl8431r4kpn4gf46l-glibc-2.26-131-dev/include/bits/math-finite.h:203:21: error: '____gammal_r_finite' was not declared in this scope
   _Mdouble_ __res = __REDIRTO (gamma, _r, _MSUF_) (__d, &__local_signgam);
                     ^
/nix/store/8hagj3k5q9vkyxnrl8431r4kpn4gf46l-glibc-2.26-131-dev/include/bits/math-finite.h:203:21: note: suggested alternative: '__gammal_r_finite'
In file included from /nix/store/8hagj3k5q9vkyxnrl8431r4kpn4gf46l-glibc-2.26-131-dev/include/math.h:773:0,
                 from /nix/store/czxcii58v6d3yhrq9r667zw91192rcgk-gcc-7.3.0/include/c++/7.3.0/cmath:45,
                 from /nix/store/czxcii58v6d3yhrq9r667zw91192rcgk-gcc-7.3.0/include/c++/7.3.0/math.h:36,
                 from shared/cube.h:13:
/nix/store/8hagj3k5q9vkyxnrl8431r4kpn4gf46l-glibc-2.26-131-dev/include/bits/math-finite.h: In function '_Float128 tgammaf128(_Float128)':
/nix/store/8hagj3k5q9vkyxnrl8431r4kpn4gf46l-glibc-2.26-131-dev/include/bits/math-finite.h:203:21: error: '____gammaf128_r_finite' was not declared in this scope
   _Mdouble_ __res = __REDIRTO (gamma, _r, _MSUF_) (__d, &__local_signgam);
                     ^
/nix/store/8hagj3k5q9vkyxnrl8431r4kpn4gf46l-glibc-2.26-131-dev/include/bits/math-finite.h:203:21: note: suggested alternative: '__gammaf128_r_finite'
make: *** [Makefile:185: shared/cube.h.gch] Error 1
builder for '/nix/store/pw47n9hr1xzrgz36z44ng833c85ak64c-sauerbraten-r5000.drv' failed with exit code 2
error: build of '/nix/store/pw47n9hr1xzrgz36z44ng833c85ak64c-sauerbraten-r5000.drv' failed

Steps to reproduce

On NixOS 18.03:

nix-env -i sauerbraten-r5000 

Technical details

The output of nix-shell -p nix-info --run "nix-info -m":

these paths will be fetched (0.32 MiB download, 1.90 MiB unpacked):
  /nix/store/9iwglb4s17wyry7avixiffglhpvqwv39-bash-4.4-p12-doc
  /nix/store/n50nxcgvx20bfyyfn9m7nzkjwzccbbai-bash-4.4-p12-dev
copying path '/nix/store/9iwglb4s17wyry7avixiffglhpvqwv39-bash-4.4-p12-doc' from 'https://cache.nixos.org'...
copying path '/nix/store/n50nxcgvx20bfyyfn9m7nzkjwzccbbai-bash-4.4-p12-dev' from 'https://cache.nixos.org'...
 - system: `"x86_64-linux"`
 - host os: `Linux 4.14.62, NixOS, 18.03.133079.5b8a24a40ce (Impala)`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.0.4`
 - channels(alexey): `"nixos-17.03-17.03.1949.78e9665b48f, nixos-17.09-17.09.3238.e984f9e48e1"`
 - channels(root): `"nixos-18.03.133079.5b8a24a40ce"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs`
lheckemann commented 6 years ago

This is because it does some weird things involving redefining some gcc/glibc-internal stuff. I usually just use the community edition with this expression:

{ stdenv, lib, fetchFromGitHub, cmake, SDL2, SDL2_image, libGL, zlib, SDL2_mixer }:
stdenv.mkDerivation {
  name = "sauerbraten-community-edition";
  src = fetchFromGitHub {
    owner = "lheckemann";
    repo = "sdos-test";
    rev = "cfa534e673a90ad826c6556c7e24a42d8ddfb226";
    sha256 = "17mvfbc094h1m576dgs0bj48chf40rdsp5ziyvd5djs6j3qkzpny";
  };
  nativeBuildInputs = [ cmake ];
  buildInputs = [ SDL2 SDL2_image libGL zlib SDL2_mixer ];
  enableParallelBuilding = true;
  SDL2_MIXER_HOME = "${SDL2_mixer}";
  installPhase = ''
    mkdir -p $out/bin
    mv Sauerbraten $out/bin
  '';
}

I should probably stick that in NUR or PR it to nixpkgs…