2

After going through the installation steps mentioned at https://fuchsia.googlesource.com/fuchsia/+/master/docs/getting_started.md

I used the command fx set x64 which produced an error in the build/gn/preprocess_products.py file.

The error message was as shown below -

(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")
^-------------------------------

How to remove this error?

xprilion
  • 569
  • 1
  • 5
  • 14

2 Answers2

2

The answer to the above problem is simple - right now Python3.7 is not supported while building Fuchsia. I changed to Python3.6 and it worked! Python 2.7 works as well.

xprilion
  • 569
  • 1
  • 5
  • 14
0

You are missing product information here. If you are not sure which product to chose then select core as the product at least which holds bringup component as well as minimal services needed for fuchsia to run.

$ fx set core.x64
Abhishek Dwivedi
  • 6,557
  • 3
  • 15
  • 20