2

完成https://fuchsia.googlesource.com/fuchsia/+/master/docs/getting_started.md中提到的安装步骤后

我使用了fx set x64在 build/gn/preprocess_products.py 文件中产生错误的命令。

错误消息如下所示 -

(base) xprilion@xl:~/fuchsia$ fx set x64
+ /home/xprilion/fuchsia/scripts/build-zircon.sh -v -g -t x64
+ /home/xprilion/fuchsia/zircon/prebuilt/downloads/gn gen /home/xprilion/fuchsia/out/build-zircon --root=/home/xprilion/fuchsia/zircon
Done. Made 12304 targets from 900 files in 3216ms
+ /home/xprilion/fuchsia/buildtools/gn gen /home/xprilion/fuchsia/out/x64 --check '--args=target_cpu="x64" import("//boards/x64.gni") import("//products/core.gni") if (!defined(available)) { available = [] } available+=[] if (!defined(preinstall)) { preinstall = [] } preinstall+=[] if (!defined(monolith)) { monolith = [] } monolith+=[]'
ERROR at //build/gn/packages.gni:71:26: Script returned non-zero exit code.
_preprocessed_products = exec_script("preprocess_products.py",
                         ^----------
Current dir: /home/xprilion/fuchsia/out/x64/
Command: /usr/bin/env /home/xprilion/fuchsia/build/gn/preprocess_products.py --monolith=["garnet/packages/products/base", "garnet/packages/prod/drivers"] --preinstall=[] --available=["garnet/packages/prod/vboot_reference", "bundles/tools"]
Returned 1.
stderr:

Traceback (most recent call last):
  File "/home/xprilion/fuchsia/build/gn/preprocess_products.py", line 11, in <module>
    from prepreprocess_build_packages import PackageImportsResolver, PackageLabelObserver
  File "/home/xprilion/fuchsia/build/gn/prepreprocess_build_packages.py", line 74
    except IOError, e:
                  ^
SyntaxError: invalid syntax

See //build/gn/BUILD.gn:7:1: whence it was imported.
import("//build/gn/packages.gni")
^-------------------------------

如何消除此错误?

4

2 回答 2

2

上述问题的答案很简单——目前在构建 Fuchsia 时不支持 Python3.7 。我改为Python3.6,它工作!Python 2.7 也可以。

于 2019-03-15T20:22:02.087 回答
0

您在这里缺少产品信息。如果您不确定要选择哪种产品,请选择core至少包含启动组件以及运行 fuchsia 所需的最少服务的产品。

$ fx set core.x64
于 2019-07-18T07:14:03.693 回答