【发布时间】:2020-01-28 07:10:13
【问题描述】:
(至少我认为这是问题所在。)
错误
当我从 nixpkgs 的根目录运行 nix-build -A serialosc 时,nix 会打印以下内容:
[jeff@jbb-dell:~/nix/nixpkgs-fork]$ nix-build -A serialosc
these derivations will be built:
/nix/store/p40wvn28grb8nrcd6scbxhhjqw4495kk-serialosc.drv
building '/nix/store/p40wvn28grb8nrcd6scbxhhjqw4495kk-serialosc.drv'...
unpacking sources
unpacking source archive /nix/store/5zj802wfjd0ima92lpzzsqdjqvrnrwf9-serialosc
source root is serialosc
patching sources
configuring
configure flags: --prefix=/nix/store/b6qzvzmwjdi29nnzc769904wc0mj1cds-serialosc configure
Setting top to : /build/serialosc
Setting out to : /build/serialosc/build
Checking for 'gcc' (C compiler) : gcc
Checking for working poll() : yes
Checking for libudev : yes
Checking for libmonome : yes
Checking for liblo : yes
Checking for function strdup : yes
Checking for function _strdup : not found
Checking for function strndup : yes
Checking for function strcasecmp : yes
Checking for header unistd.h : yes
Checking for header dns_sd.h : yes
Checking for library dl : yes
Traceback (most recent call last):
File "/build/serialosc/.waf-1.8.5-3fc7b0f5070c04bfd3f2489448471a84/waflib/Scripting.py", line 103, in waf_entry_point
run_commands()
File "/build/serialosc/.waf-1.8.5-3fc7b0f5070c04bfd3f2489448471a84/waflib/Scripting.py", line 164, in run_commands
ctx=run_command(cmd_name)
File "/build/serialosc/.waf-1.8.5-3fc7b0f5070c04bfd3f2489448471a84/waflib/Scripting.py", line 155, in run_command
ctx.execute()
File "/build/serialosc/.waf-1.8.5-3fc7b0f5070c04bfd3f2489448471a84/waflib/Configure.py", line 92, in execute
super(ConfigurationContext,self).execute()
File "/build/serialosc/.waf-1.8.5-3fc7b0f5070c04bfd3f2489448471a84/waflib/Context.py", line 92, in execute
self.recurse([os.path.dirname(g_module.root_path)])
File "/build/serialosc/.waf-1.8.5-3fc7b0f5070c04bfd3f2489448471a84/waflib/Context.py", line 133, in recurse
user_function(self)
File "/build/serialosc/wscript", line 259, in configure
stderr=devnull).decode().strip()
File "/nix/store/lbrpma3528hq7gwn8ffbnwaxvsqah0bb-python-2.7.17/lib/python2.7/subprocess.py", line 216, in check_output
process = Popen(stdout=PIPE, *popenargs, **kwargs)
File "/nix/store/lbrpma3528hq7gwn8ffbnwaxvsqah0bb-python-2.7.17/lib/python2.7/subprocess.py", line 394, in __init__
errread, errwrite)
File "/nix/store/lbrpma3528hq7gwn8ffbnwaxvsqah0bb-python-2.7.17/lib/python2.7/subprocess.py", line 1047, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
builder for '/nix/store/p40wvn28grb8nrcd6scbxhhjqw4495kk-serialosc.drv' failed with exit code 2
error: build of '/nix/store/p40wvn28grb8nrcd6scbxhhjqw4495kk-serialosc.drv' failed
[jeff@jbb-dell:~/nix/nixpkgs-fork]$
我的怀疑
问题似乎出现在lib/python2.7/subprocess.py。我在网上找到了a version of that file,而definition of _execute_child 似乎引用了一些绝对路径——例如,在这段话中:
if shell:
args = ["/bin/sh", "-c"] + args
if executable:
args[0] = executable
因此,我的猜测是 Nix 是在一个沙盒中构建的,它不提供 Python 所期望的任何东西。但错误并没有告诉我 Python 希望找到什么。
上下文
(您可能不需要此信息。)
我正在尝试在 NixOS 19.09 上build serialosc。这是我的fork of nixpkgs,包括我的broken recipe for serialosc。这个分支还包括我的libmonome 包,它可以工作,serialosc 依赖于它,它还不是官方nixpkgs 存储库的一部分。我已经给出了具体提交的硬链接;当我更新分叉时,它们不应该改变。
【问题讨论】:
-
就个人而言,我会通过使用 sysdig 来跟踪失败的
execve()调用试图调用什么来调试它。 (在 NixOS 上,您可能需要小心使用哪个内核包——至少有一段时间,sysdig 无法使用 nixpkgs 中的默认内核构建;但希望现在已经修复,如果上游没有修复,它在任何情况下都是可修复的)。
标签: python-2.7 sandbox nix nixos