Nix:建立`waf`会产生一个文件,但是我似乎需要一个文件夹 [英] Nix: Building `waf` produces a file, but I seem to need a folder

查看:145
本文介绍了Nix:建立`waf`会产生一个文件,但是我似乎需要一个文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经克隆了 nixpkgs存储库.在该存储库的顶部,我可以运行nix-build -A waf来构建waf,并运行nix-env -f . -iA waf来使waf成为我的用户环境的一部分.都没有抱怨-但是之后我仍然无法拨打waf:

I've cloned the nixpkgs repo. From the top of that repo, I can run nix-build -A waf to build waf, and nix-env -f . -iA waf to make waf part of my user environment. Neither complains -- but afterward I am still unable to call waf:

[jeff@jbb-dell:~/nix/nixpkgs]$ waf
waf: command not found

[jeff@jbb-dell:~/nix/nixpkgs]$ 

大多数软件包,当我使用nix-build -A生成它们时,会产生一个名为result的符号链接,该链接会转到包含相关可执行文件的文件夹中.但是,奇怪的是,在waf的情况下,符号链接是指向文件而不是文件夹.

Most packages, when I build them using nix-build -A, produce a symlink called result that goes to a folder containing the executable in question. Strangely, though, in waf's case the symlink is to a file, not a folder.

我正在运行NixOS.如果我在配置中将waf添加到 environment.systemPackages ,在构建时,我收到一个错误,该错误似乎是由于上一段中所述的陌生性造成的:

I'm running NixOS. If I add waf to environment.systemPackages in my configuration, upon building I get an error that seems to be a result of the strangeness described in the previous paragraph:

[jeff@jbb-dell:~/nix/jbb-config]$ sudo nixos-rebuild switch
building Nix...
building the system configuration...
these derivations will be built:
  /nix/store/s618gllra3g2vn62c92advg9ks2swkz1-system-path.drv
  /nix/store/gpph3adrgn949mikfvkwld86flshdbvq-unit-polkit.service.drv
  /nix/store/i7xql7889ank54fnhd16zk4z79l1ix88-unit-systemd-fsck-.service.drv
  /nix/store/dv9p4fsrqn1fwdvy9scyc7g9422wvm7c-dbus-1.drv
  /nix/store/y730jf9s9nrzmkf55i01nlwinw5gxpsp-unit-dbus.service.drv
  /nix/store/4wjan71p2di7lscnscdfhp55j49dcymx-system-units.drv
  /nix/store/qrzwrpsz0hh5gzaxic6ww8mnwl03zwil-unit-dbus.service.drv
  /nix/store/lhq0s9s5v3sqvjx6mqlyqj6hf4kv38sf-user-units.drv
  /nix/store/hk5wbmf4dpna3dn0h0q1balj3482l6xd-etc.drv
  /nix/store/yj3lfyv5sbp751xzy9jdw1d06n9gdiin-nixos-system-jbb-dell-19.09.1889.692a8cabbcc.drv
building '/nix/store/s618gllra3g2vn62c92advg9ks2swkz1-system-path.drv'...
The store path /nix/store/f1ylicjswpfx1wbvxapsnwy987qnlxl6-waf-2.0.18 is a file and can't be merged into an environment us ing pkgs.buildEnv! at /nix/store/kncarzyhspzsplkcmmyiqg2cavrwr373-builder.pl line 96.
builder for '/nix/store/s618gllra3g2vn62c92advg9ks2swkz1-system-path.drv' failed with exit code 2
cannot build derivation '/nix/store/yj3lfyv5sbp751xzy9jdw1d06n9gdiin-nixos-system-jbb-dell-19.09.1889.692a8cabbcc.drv': 1 dependencies couldn't be built
error: build of '/nix/store/yj3lfyv5sbp751xzy9jdw1d06n9gdiin-nixos-system-jbb-dell-19.09.1889.692a8cabbcc.drv' failed

[jeff@jbb-dell:~/nix/jbb-config]$ 

推荐答案

对我来说,这似乎是一个实现错误.作为顶级Nixpkgs软件包,waf应该将其二进制文件放在$out/bin中. 我已经检查了nixpkgswaf用法,并且似乎只能通过wafHook在内部派生中使用.

This looks like an implementation error to me. waf, as a top-level Nixpkgs package, should put its binary in $out/bin. I've checked for usages of waf in nixpkgs and it seems to be used inside derivations only via wafHook.

如果在派生中只需要waf,我建议按照其他软件包的示例使用wafHook.如果需要将其安装在用户配置文件中,则理想情况下,您可以发送PR来使waf成为正确的软件包,或者可以通过自定义派生来解决它.

If you only need waf inside a derivation, I recommend going with wafHook, following the example of other packages. If you need to install it in your user profile, ideally you can send a PR to make waf a proper package or you can work around it with a custom derivation.

这篇关于Nix:建立`waf`会产生一个文件,但是我似乎需要一个文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆