Nixpkgs: gfan: fails to build: setoper.h: No such file or directory

Created on 15 Oct 2020  路  3Comments  路  Source: NixOS/nixpkgs

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:

  1. nix-build -A gfan

Expected behavior
The package is built successfully.

Notify maintainers
@7c6f434c (gfan, cddlib), @timokau (cddlib)

Metadata

  • system: "x86_64-linux"
  • host os: Linux 5.4.70-hardened, NixOS, 20.03.3133.3a10a004bb5 (Markhor)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.3.6
  • channels(root): "nixos-20.03.3133.3a10a004bb5"
  • channels(omasanori): ""
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute:
  - nixpkgs.gfan
# a list of nixos modules affected by the problem
module:
bug

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 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. 馃槈

All 3 comments

cddlib put its .h file in -cddlib-0.94l/include/cddlib/

rather than the old version of the library placing it .h headers in the root.

-cddlib-0.94j/include/

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

v0.94k

  • header files are now installed to PREFIX/include/cddlib to avoid clashes
    with other libraries.
  • configuration file for pkg-config added: assuming cddlib installed in
    known to pkg-config, "pkg-config --cflags cddlib" etc will
    work. (Otherwise, one would need PKG_CONFIG_PATH=/lib/pkgconfig).

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. 馃槈

Was this page helpful?
0 / 5 - 0 ratings

Related issues

spacekitteh picture spacekitteh  路  3Comments

ghost picture ghost  路  3Comments

ayyess picture ayyess  路  3Comments

sid-kap picture sid-kap  路  3Comments

matthiasbeyer picture matthiasbeyer  路  3Comments