0

I've added the following nix expression to my project (verbatem from nixpkgs) and tried to build it, but I get the following error message:

these derivations will be built:
  /nix/store/l6l5j1gas74pnzc2pb8w9fv2namxpgki-godot-3.0.6.drv
building '/nix/store/l6l5j1gas74pnzc2pb8w9fv2namxpgki-godot-3.0.6.drv'...
unpacking sources
unpacking source archive /nix/store/mlbp5ibpyq2rd710fl43pwr6a03ysz57-source
source root is source
patching sources
applying patch /nix/store/yk47p909lklbcai94izb5dfqjqqnnxmc-pkg_config_additions.patch
patching file platform/x11/detect.py
applying patch /nix/store/sdr3xp65cibpd06vq4fg5czv2s3m6a3c-dont_clobber_environment.patch
patching file SConstruct
configuring
no configure script, doing nothing
building
no Makefile, doing nothing
installing
cp: missing destination file operand after '/nix/store/mxvinscpfbv3k5j7dvpa83pd4w1p1f4f-godot-3.0.6/bin/godot'
Try 'cp --help' for more information.
builder for '/nix/store/l6l5j1gas74pnzc2pb8w9fv2namxpgki-godot-3.0.6.drv' failed with exit code 1

What could be causing this? Note that when I simply add godot to my nix config (in NixOS using nixos-18.09 channel), it installs and runs just fine. Aren't these the same expressions? If so, why does it work globally and not locally?

NOTE: Here is the part of the nix expression that invokes the cp shell command (related to the error above):

  installPhase = ''
    mkdir -p "$out/bin"
    cp bin/godot.* $out/bin/godot

    mkdir "$dev"
    cp -r modules/gdnative/include $dev

    mkdir -p "$man/share/man/man6"
    cp misc/dist/linux/godot.6 "$man/share/man/man6/"

    mkdir -p "$out"/share/{applications,icons/hicolor/scalable/apps}
    cp misc/dist/linux/godot.desktop "$out/share/applications/"
    cp icon.svg "$out/share/icons/hicolor/scalable/apps/godot.svg"
    cp icon.png "$out/share/icons/godot.png"
    substituteInPlace "$out/share/applications/godot.desktop" \
      --replace "Exec=godot" "Exec=$out/bin/godot"
  '';
George
  • 6,927
  • 4
  • 34
  • 67
  • I'd recommend putting `set -xe` at the beginning of the file to debug what it does. – iElectric Feb 28 '19 at 06:35
  • Are you providing the same inputs to the Godot Nix expression that the Nixpkgs top-level Nix expression does? The Godot Nix expression has three optional inputs that could effect the outcome of the build. Also, try building with the *keep* option so you can inspect the build environment. – Emmanuel Rosa Feb 28 '19 at 14:57
  • @EmmanuelRosa: (i) I'm not providing any inputs to the nix expression myself; how do I determined what arguments its being provided by nixpkgs top-level? (ii) What do you mean by the "*keep*" option? Do you mean `--keep-going`? – George Feb 28 '19 at 19:56
  • @iElectric: Running `set -xe` shows that `cp bin/godot.* $out/bin/godot` is evaluating to `cp $out/bin/godot`, which I think means there's nothing in `$out/bin`. This makes sense because nothing seems to compile! But why would nothing be compiling? – George Feb 28 '19 at 20:10
  • Hmm... how did you add the Nix expression to your project? What command are you running to invoke the build? – Emmanuel Rosa Mar 01 '19 at 10:03
  • @EmmanuelRosa: Via haskell+stack (in a shell.nix). However, I figured out a way around the problem: simply backtrack by one commit to fetch the older nix expression. – George Mar 01 '19 at 14:41

0 Answers0