我正在尝试从this link构建adblockplus。当我发出命令时:
python build.py build
我最终收到以下错误消息。我尝试使用和不使用sudo都无济于事。
Traceback (most recent call last):
File "build.py", line 10, in <module>
buildtools.build.processArgs('.', sys.argv)
File "/home/machine/projects/weird/buildtools/build.py", line 352, in processArgs
commands[command](baseDir, scriptName, opts, args, type)
File "/home/machine/projects/weird/buildtools/build.py", line 39, in __call__
return self._handler(baseDir, scriptName, opts, args, type)
File "/home/machine/projects/weird/buildtools/build.py", line 166, in runBuild
limitMetadata=limitMetadata)
File "/home/machine/projects/weird/buildtools/packager.py", line 274, in createBuild
buildNum = getBuildNum(baseDir)
File "/home/machine/projects/weird/buildtools/packager.py", line 80, in getBuildNum
(result, dummy) = subprocess.Popen(['hg', 'id', '-n'], stdout=subprocess.PIPE).communicate()
File "/usr/lib/python2.6/subprocess.py", line 623, in __init__
errread, errwrite)
File "/usr/lib/python2.6/subprocess.py", line 1141, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
我错过了一个包吗?任何关于问题的暗示都将受到高度赞赏。
答案 0 :(得分:4)
堆栈跟踪清楚地表明问题是由以下行引起的:
(result, dummy) = subprocess.Popen(['hg', 'id', '-n'], stdout=subprocess.PIPE).communicate()
如果查看subprocess
package documentation,此行正在尝试运行hg id -n
命令(获取数字Mercurial修订版)。显然,Mercurial命令行工具在您的系统上不存在(此构建脚本可能不考虑这种情况),因此它失败。
免责声明:我恰好是编写此脚本的人,我现在fixed this bug。 Mercurial对于构建不是必需的,修订号几乎只是确定输出文件名所必需的。