1

我正在尝试从此链接构建 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

我错过了一个包裹吗?任何关于问题可能是什么的提示将不胜感激。

4

1 回答 1

4

The stack trace makes it clear that the issue is caused by the following line:

(result, dummy) = subprocess.Popen(['hg', 'id', '-n'], stdout=subprocess.PIPE).communicate()

If you look at the subprocess package documentation, this line is trying to run the hg id -n command (get numerical Mercurial revision). Apparently, the Mercurial command line tool isn't present on your system (a possibility that this build script didn't consider) so it fails.

Disclaimer: I happen to be the one who wrote this script and I fixed this bug now. Mercurial isn't essential for the build, the revision number is pretty much only necessary to determine the output file name.

于 2012-06-08T13:19:09.820 回答