编译 Mozilla Firefox 时创建 ./config.data 失败

creating ./config.data failed while compiling Mozilla Firefox

当我使用命令进行编译时,我的 mozilla 编译失败了。我只是使用 mozilla 的默认代码。

mach build

有以下错误

2:39.43 creating ./config.data
 2:46.33
 2:53.91
 2:54.26 Creating config.status
 2:54.26 Traceback (most recent call last):
 2:54.26   File "c:/mozilla-source/mozilla-central/configure.py", line 124, in <module>
 2:54.26     sys.exit(main(sys.argv))
 2:54.26   File "c:/mozilla-source/mozilla-central/configure.py", line 34, in main
 2:54.26     return config_status(config)
 2:54.26   File "c:/mozilla-source/mozilla-central/configure.py", line 109, in config_status
 2:54.26     from mozbuild.config_status import config_status
 2:54.26   File "c:\mozilla-source\mozilla-central\python\mozbuild\mozbuild\config_status.py", line 21, in <module>
 2:54.26     from mozbuild.base import MachCommandConditions
 2:54.26   File "c:\mozilla-source\mozilla-central\python\mozbuild\mozbuild\base.py", line 17, in <module>
 2:54.26     from mach.mixin.process import ProcessExecutionMixin
 2:54.26   File "c:\mozilla-source\mozilla-central\python\mach\mach\mixin\process.py", line 14, in <module>
 2:54.26     from mozprocess.processhandler import ProcessHandlerMixin
 2:54.26 ImportError: No module named mozprocess.processhandler
 2:54.37 *** Fix above errors and then restart with\
 2:54.37                "c:/mozilla-build/mozmake/mozmake.EXE -f client.mk build"
 2:54.39 c:/mozilla-source/mozilla-central/client.mk:379: recipe for target 'configure' failed
 2:54.39 mozmake.EXE[2]: *** [configure] Error 1
 2:54.39 c:/mozilla-source/mozilla-central/client.mk:396: recipe for target 'c:/mozilla-source/mozilla-central/obj-i686-pc-mingw32/Makefile' failed
 2:54.39 mozmake.EXE[1]: *** [c:/mozilla-source/mozilla-central/obj-i686-pc-mingw32/Makefile] Error 2
 2:54.39 client.mk:170: recipe for target 'build' failed
 2:54.39 mozmake.EXE: *** [build] Error 2
 2:54.41 0 compiler warnings present.
2

下一行给出了错误

if config.get('MOZ_BUILD_APP') != 'js' or config.get('JS_STANDALONE'):
    os.environ[b'WRITE_MOZINFO'] = b'1'
    from mozbuild.config_status import config_status

如何解决这个问题。

mozilla-source\mozilla-central\python\ mozprocess 中缺少库。 您需要从 https://pypi.python.org/pypi/mozprocess/0.8 下载 mozprocess 库并解压缩到 mozilla-source\mozilla-central\python\ 并再次编译。它应该可以正常编译。

我运行遇到了同样的问题,这里现有的解决方案对我没有帮助。

我之前有 运行 ./bootstrap.py 来安装系统级依赖项。

还有一个 ./mach bootstrap 步骤在 objdir 中创建一个 _virtualenv 目录并在那里安装 python 模块。显然它没有考虑我的 objdir 配置,所以它安装在错误的目录中。然后构建不知何故只创建了一半。

我通过删除所有 _virtualdev 并重新启动 ./mach build 来修复它。然后这次自动正确设置 _virtualdev,并正确启动构建。

不需要./mach bootstrap,它会自动完成。不要使用 make -f client.mk。它不做所有的引导。只需 ./bootstrap.py./mach build 就足够了。