Describe the bug
Building /nix/store/9mi04kgd0l886j0jbwr16c7fx2pmf5pf-gfan-0.6.2.drv fails with the following messages:
$ nix-build -A gfan
these derivations will be built:
/nix/store/9mi04kgd0l886j0jbwr16c7fx2pmf5pf-gfan-0.6.2.drv
building '/nix/store/9mi04kgd0l886j0jbwr16c7fx2pmf5pf-gfan-0.6.2.drv'...
unpacking sources
unpacking source archive /nix/store/a343sk3xjzjwf97d6sc70d53qi5hzryk-gfan0.6.2.tar.gz
source root is gfan0.6.2
setting SOURCE_DATE_EPOCH to timestamp 1506606252 of file gfan0.6.2/Makefile
patching sources
configuring
no configure script, doing nothing
building
build flags: SHELL=/nix/store/k8p54jg8ipvnfz435mayf5bnqhw4qqap-bash-4.4-p23/bin/bash CC=cc CXX=c++ cddnoprefix=1
c++ -DGMPRATIONAL -Wuninitialized -fno-omit-frame-pointer -O2 -g -std=c++0x -g -DNOCDDPREFIX -c src/polynomialgcd.cpp -o src/polynomialgcd.o
c++ -DGMPRATIONAL -Wuninitialized -fno-omit-frame-pointer -O2 -g -std=c++0x -g -DNOCDDPREFIX -c src/lp_cdd.cpp -o src/lp_cdd.o
src/lp_cdd.cpp:4:10: fatal error: setoper.h: No such file or directory
4 | #include "setoper.h"
| ^~~~~~~~~~~
compilation terminated.
make: *** [Makefile:549: src/lp_cdd.o] Error 1
builder for '/nix/store/9mi04kgd0l886j0jbwr16c7fx2pmf5pf-gfan-0.6.2.drv' failed with exit code 2
error: build of '/nix/store/9mi04kgd0l886j0jbwr16c7fx2pmf5pf-gfan-0.6.2.drv' failed
Note that git bisect points to https://github.com/NixOS/nixpkgs/commit/22212571164eff6af18c5dec90ecf17cdc1387ce which updates cddlib.
To Reproduce
Steps to reproduce the behavior:
nix-build -A gfanExpected behavior
The package is built successfully.
Notify maintainers
@7c6f434c (gfan, cddlib), @timokau (cddlib)
Metadata
"x86_64-linux"Linux 5.4.70-hardened, NixOS, 20.03.3133.3a10a004bb5 (Markhor)yesyesnix-env (Nix) 2.3.6"nixos-20.03.3133.3a10a004bb5"""/nix/var/nix/profiles/per-user/root/channels/nixosMaintainer information:
# a list of nixpkgs attributes affected by the problem
attribute:
- nixpkgs.gfan
# a list of nixos modules affected by the problem
module:
cddlib put its .h file in
rather than the old version of the library placing it .h headers in the root.
So options are
get upstream to #include "cddlib/setoper.h" (and the rest of the directly pathed includes)
Patch it in the derivation
Take a look at the library is being built...and why it differs from 0.94j to 0.94l ...... and see if can be symlinked (botched).
not sure why it's subpathing these .h file now?
https://github.com/cddlib/cddlib/blob/master/ChangeLog
this is the source of the breakage.
https://github.com/cddlib/cddlib/commit/7762b6eddbb7eea6e5bf733afaccb8f6f9c57ec8
this probably breaks everything that uses this library.... lovely!
So, options are fix it gfan upstream, or patch it in nix??????
https://github.com/cddlib/cddlib/pull/38
has a 41 length thread, where the developers are trying to workout how not to break any application that uses this library and which distro's they want to break.
Thank you for your survey, @nixinator!
The long-term solution would be fixing gfan upstream, given that this is not Nix-specific. The current Makefile assumes that, if cddlib headers are prefixed, the prefix is cdd/ instead of cddlib/. A variable to change the prefix will help every package maintainer IMHO. However, adding a patch to gfan just altering cdd/ with cddlib/ into nixpkg may be fine for now.
I will try to address it next week but feel free to make a PR if it is urgent for anyone. 馃槈
Most helpful comment
Thank you for your survey, @nixinator!
The long-term solution would be fixing gfan upstream, given that this is not Nix-specific. The current Makefile assumes that, if cddlib headers are prefixed, the prefix is
cdd/instead ofcddlib/. A variable to change the prefix will help every package maintainer IMHO. However, adding a patch to gfan just alteringcdd/withcddlib/into nixpkg may be fine for now.I will try to address it next week but feel free to make a PR if it is urgent for anyone. 馃槈