Nixpkgs: Vim: Configurable.nix fails with 'gdk/gdkx.h' file not found

Created on 28 Sep 2018  路  9Comments  路  Source: NixOS/nixpkgs

Issue description

when trying to build vim with configuration from configurable.nix it fails with:
'gdk/gdkx.h' file not found
This issue just started to happen 5 days ago when I updated my nix to 2.1.2, before that it did build this derivation.

Steps to reproduce

On Darwin:
Try to run in nix repl:

configurable_nix_path = <nixpkgs/pkgs/applications/editors/vim/configurable.nix>
conf = callPackage configurable_nix_path {     inherit (darwin.apple_sdk.frameworks) CoreServices Cocoa Foundation CoreData;     inherit (darwin) libobjc cf-private; features = "big" ;  lua = pkgs.lua5_1; gui =  "auto"; python = python3; flags = [ "python" "X11" ];   } 

:b conf 

results in:
builder for '/nix/store/amr6bd2gls64r3mgai1h8ark82k1amk5-vim_configurable-8.1.0348.drv' failed with exit code 2; last 10 log lines:
  clang -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -I/nix/store/90sdxc92s80gq5h66cdc7rpvq47325dy-glib-2.56.0-dev/include/glib-2.0 -I/nix/store/r0nwmg3mnf9h4fqk0gmcl1n3d9ddc9mq-glib-2.56.0/lib/glib-2.0/include -I/nix/store/ckp1fc8cyj832am954vry2iihrmq0syh-gtk+3-3.22.30-dev/include/gtk-3.0 -I/nix/store/n35dv0iq3589n705s4psb2aak21icy98-cairo-1.15.12-dev/include/cairo -I/nix/store/5vshc454dh849g0z8zk24pmabzsaa4h9-freetype-2.9-dev/include/freetype2 -I/nix/store/5vshc454dh849g0z8zk24pmabzsaa4h9-freetype-2.9-dev/include -I/nix/store/8kx6bqwf5a9c71cky7slw4f55dx0rbzq-pango-1.42.4-dev/include/pango-1.0 -I/nix/store/gpdkjs7hmw03y818yj66p143qd0i5hkb-gdk-pixbuf-2.36.12-dev/include/gdk-pixbuf-2.0 -I/nix/store/2p3xzwc4b29r83h0zij4a7pv51i02379-atk-2.28.1-dev/include/atk-1.0 -DMACOS_X  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1        -o objects/ops.o ops.c
  mbyte.c:123:12: fatal error: 'gdk/gdkx.h' file not found
  #  include <gdk/gdkx.h>
             ^~~~~~~~~~~~
  clang -c -I. -I/nix/store/3w4pbwzsn3awdai9az74sw332iix3dcq-lua-5.1.5/include   -I/nix/store/zikcgg9visw3cwnyzbpkp1p2rj6zm5xr-python3-3.6.6/include/python3.6m -fPIE -I/nix/store/7s5p6cwgz63pp1wgln9f7bg7sgy5jyrm-ruby-2.5.1/include/ruby-2.5.0 -I/nix/store/7s5p6cwgz63pp1wgln9f7bg7sgy5jyrm-ruby-2.5.1/include/ruby-2.5.0/x86_64-darwin16 -DRUBY_VERSION=25  -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -I/nix/store/90sdxc92s80gq5h66cdc7rpvq47325dy-glib-2.56.0-dev/include/glib-2.0 -I/nix/store/r0nwmg3mnf9h4fqk0gmcl1n3d9ddc9mq-glib-2.56.0/lib/glib-2.0/include -I/nix/store/ckp1fc8cyj832am954vry2iihrmq0syh-gtk+3-3.22.30-dev/include/gtk-3.0 -I/nix/store/n35dv0iq3589n705s4psb2aak21icy98-cairo-1.15.12-dev/include/cairo -I/nix/store/5vshc454dh849g0z8zk24pmabzsaa4h9-freetype-2.9-dev/include/freetype2 -I/nix/store/5vshc454dh849g0z8zk24pmabzsaa4h9-freetype-2.9-dev/include -I/nix/store/8kx6bqwf5a9c71cky7slw4f55dx0rbzq-pango-1.42.4-dev/include/pango-1.0 -I/nix/store/gpdkjs7hmw03y818yj66p143qd0i5hkb-gdk-pixbuf-2.36.12-dev/include/gdk-pixbuf-2.0 -I/nix/store/2p3xzwc4b29r83h0zij4a7pv51i02379-atk-2.28.1-dev/include/atk-1.0 -DMACOS_X  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1        -o objects/option.o option.c
  1 error generated.
  make[1]: *** [Makefile:3099: objects/mbyte.o] Error 1
  make[1]: *** Waiting for unfinished jobs....
  make[1]: Leaving directory '/private/var/folders/0l/h15hb2l52js7j9yr_xlhzmfm0000gp/T/nix-build-vim_configurable-8.1.0348.drv-1/source/src'
  make: *** [Makefile:29: first] Error 2
[0 built (1 failed)]
error: build of '/nix/store/amr6bd2gls64r3mgai1h8ark82k1amk5-vim_configurable-8.1.0348.drv' failed


Technical details

  • system: "x86_64-darwin"
  • host os: Darwin 16.7.0, macOS 10.12.6
  • multi-user?: no
  • sandbox: no
  • version: nix-env (Nix) 2.1.2
  • channels(oren): "nixpkgs-19.03pre153603.4ad424fbd63, nixpkgs-18.09-darwin-18.09pre152179.3c85e586b39"
  • nixpkgs: /Users/oren/.nix-defexpr/channels/nixpkgs
darwin

Most helpful comment

Worked around this by disabling the GUI, works well if you don't need it:

vim = vim_configurable.overrideAttrs (oa:
  {
    configureFlags = lib.filter
      (f: ! lib.hasPrefix "--enable-gui" f) oa.configureFlags;

  });

All 9 comments

So this only seems to affect the configurable vim, not the regular one? That would suggest that there's a simple compatibility fix that someone made to the main derivation that wasn't applied to configurable.

I can't look at it right now but anyone in @NixOS/darwin-maintainers know what's up with this header?

Did you override guiSupport or set config.vim.gui?

@LnL7 my call to configurable_nix_path as gui = "auto", if this what you mean.

Yeah that's the problem, gtk is included conditionally depending on what version is requested.

https://github.com/NixOS/nixpkgs/blob/c66c46943380a2f09df07c913098f5feeae5c6cf/pkgs/applications/editors/vim/configurable.nix#L132-L133

Running without it(leaving the default value for the GUI) is still causing the error.

I'm still having this issue - did you get it working in the end? Would you mind sharing how..?

@sam-willis I had my vim pkgs set pinned to 1803 and it worked. today I was trying to update the latest nixpkgs to build vim with and I still get this error.

In Darwin(MacOS 10.15) I was not able to compile a vim from vim/configurable but for what I was looking for (compile it with python and Lua support) I was able to compile from vim/default.nix
this is what worked for me:

let 
  pkgs = import <nixpkgs>{};
  vim = import <nixpkgs/pkgs/applications/editors/vim>;
  customVim = (pkgs.callPackage vim {
    inherit (pkgs.darwin.apple_sdk.frameworks) Cocoa Carbon;
  }).overrideDerivation (self : {
    buildInputs = self.buildInputs ++ [ pkgs.python37 ];
    configureFlags = self.configureFlags ++
    [
      #python support
      "--enable-python3interp=yes"
      "--with-python3-config-dir=${pkgs.python37}/lib"
      "--with-python3-command=python3.7"

      #lua support
      "--with-lua-prefix=${pkgs.lua}"
      "--enable-luainterp"
    ];
  });
in customVim

Worked around this by disabling the GUI, works well if you don't need it:

vim = vim_configurable.overrideAttrs (oa:
  {
    configureFlags = lib.filter
      (f: ! lib.hasPrefix "--enable-gui" f) oa.configureFlags;

  });
Was this page helpful?
0 / 5 - 0 ratings

Related issues

ob7 picture ob7  路  3Comments

matthiasbeyer picture matthiasbeyer  路  3Comments

grahamc picture grahamc  路  3Comments

lverns picture lverns  路  3Comments

spacekitteh picture spacekitteh  路  3Comments