Revery: Build Error: bin/gn: No such file or directory

Created on 27 Dec 2019  路  11Comments  路  Source: revery-ui/revery


The build ran for about 30 minutes, then produced this error:

$ esy build
...
info esy build 0.5.8 (using package.json)
info building esy-skia@github:revery-ui/esy-skia#ff2e46d@d41d8cd9
error: build failed with exit code: 1
  build log:
    # esy-build-package: building: esy-skia@github:revery-ui/esy-skia#ff2e46d
    # esy-build-package: pwd: /home/justin/.esy/3___________________________________________________________________/b/esy_skia-6661997b
    # esy-build-package: running: 'bash' './esy/build.sh' 'linux' '/home/justin/.esy/3___________________________________________________________________/i/esy_libjpeg_turbo-9be23a38'
    Traceback (most recent call last):
      File "tools/git-sync-deps", line 253, in <module>
        exit(main(sys.argv[1:]))
      File "tools/git-sync-deps", line 245, in main
        git_sync_deps(deps_file_path, argv, verbose)
      File "tools/git-sync-deps", line 190, in git_sync_deps
        deps_file = parse_file_to_dict(deps_file_path)
      File "tools/git-sync-deps", line 170, in parse_file_to_dict
        execfile(path, dictionary)
    NameError: name 'execfile' is not defined
    ./esy/build.sh: line 20: bin/gn: No such file or directory
    error: command failed: 'bash' './esy/build.sh' 'linux' '/home/justin/.esy/3___________________________________________________________________/i/esy_libjpeg_turbo-9be23a38' (exited with 255)
    esy-build-package: exiting with errors above...

  building esy-skia@github:revery-ui/esy-skia#ff2e46d
esy: exiting due to errors above
  • Operating System:
$ uname -a
Linux justin-pc 4.14.154-1-MANJARO #1 SMP PREEMPT Wed Nov 13 12:45:06 UTC 2019 x86_64 GNU/Linux
  • Revery Version:
    Attempting to build from source
  • OCaml version:
    I don't know how to check this. When I type ocaml in my terminal nothing shows up. Total ocaml noob here!
  • Native, Bytecode, or JS build:
    Not sure what this means. esy is version 0.5.8. Node is v12.13.0

Debugging attempts:

I neglected to install these before running esy install and esy build but installed them after I hit this error and the error wasn't resolved.

I also installed gn but that didn't fix it either.

A-infrastructure A-technical bug platform-linux

Most helpful comment

In Manjaro Linux, python points at python 3. It seems this sync-git-deps script needs to be run with Python 2 (???)

All 11 comments

In Manjaro Linux, python points at python 3. It seems this sync-git-deps script needs to be run with Python 2 (???)

You are right skia need python 2 only for the build step. we are awaiting this PR where build script support either 2 and 3 can you symlink only for the build step ? Maybe we can include it before it gets merged upstream. What do you think @bryphe

I can't even find this tools/git-sync-deps script on my system.

If I could I would just edit the first line here to explicitely call python2

@justinmoon seems to be in $HOME/.esy/(...)/tools/git-sync-deps

In /home/david/.esy/source/i/esy_skia__8c400e47/tools/git-sync-deps, I replaced:

def parse_file_to_dict(path):
  dictionary = {}
  execfile(path, dictionary)
  return dictionary

with:

def parse_file_to_dict(path):
  dictionary = {}
  exec(compile(open(path, "rb").read(), path, 'exec'), dictionary)
  return dictionary

which is the output of 2to3, as suggested here. Then esy build ~works~ no more crash but seems to freeze :(.

Edit: after a long time, esy-skia fails on import urllib2 (Python 2 vs Python 3), so I think we need the full PR mentioned by @Et7f3

@dfroger, @justinmoon thanks for reporting this issue! I agree that this should be caused by an inconsistent version of python that we get through esy-bash - on some platforms, python means python 2.7, on others, we get python 3.x.

I tried to cherry-pick the python 3 compatibility changes into our fork of skia at https://github.com/revery-ui/esy-skia/pull/5
Can you please try this out directly by adding the following line to your resolutions inside the revery package.json?

    "esy-skia": "revery-ui/esy-skia#5535b6979ee66cebf950c60b6f157d84b15e1e70"

Afterwards, please run esy install and esy build again to figure out if something improved. I can't try it out myself unfortunately since my platform will always install python 2.7.

Hi @manuhornung, thanks. I've made the change in package.json and I esy install. esy build now fails like this (I'm using Archlinux):

$ esy build
info esy build 0.5.8 (using package.json)
info building esy-skia@github:revery-ui/esy-skia#5535b6979ee66cebf950c60b6f157d84b15e1e70@d41d8cd9
error: build failed with exit code: 1
  build log:
    # esy-build-package: building: esy-skia@github:revery-ui/esy-skia#5535b6979ee66cebf950c60b6f157d84b15e1e70
    # esy-build-package: pwd: /home/david/.esy/3____________________________________________________________________/b/esy_skia-9d146d11
    # esy-build-package: running: 'bash' './esy/build.sh' 'linux' '/home/david/.esy/3____________________________________________________________________/i/esy_libjpeg_turbo-9be23a38'
    common                               @ 9737551d7a52c3db3262db5856e6bcd62c462b92
    third_party/externals/piex           @ bb217acdca1cc0c16b704669dd6f91a1b509c406
    buildtools                           @ 505de88083136eefd056e5ee4ca0f01fe9b33de8
    third_party/externals/spirv-headers  @ 661ad91124e6af2272afd00f804d8aa276e17107
    third_party/externals/zlib           @ e7afdfe128e01ca480a28f757b571957befdd962
    third_party/externals/dng_sdk        @ 96443b262250c390b0caefbf3eed8463ba35ecae
    third_party/externals/microhttpd     @ 748945ec6f1c67b7efc934ab0808e1d32f2fb98d
    third_party/externals/jsoncpp        @ 1.0.0
    third_party/externals/lua            @ v5-3-4
    third_party/externals/googletest     @ dd43b9998e9a44a579a7aba6c1309407d1a5ed95
    third_party/externals/libjpeg-turbo  @ 1.5.3
    third_party/externals/expat          @ android-6.0.1_r55
    third_party/externals/libwebp        @ v0.6.1
    third_party/externals/spirv-tools    @ e9e4393b1c5aad7553c05782acefbe32b42644bd
    third_party/externals/rapidjson      @ af223d44f4e8d3772cb1ac0ce8bc2a132b51717f
    third_party/externals/freetype       @ fa6da7bf6dcbcfa22d2464259ad1cccee3233189
    third_party/externals/sfntly         @ b18b09b6114b9b7fe6fc2f96d8b15e8a72f66916
    third_party/externals/harfbuzz       @ 1.4.2
    third_party/externals/imgui          @ 6384eee34f08cb7eab8d835043e1738e4adcdf75
    third_party/externals/sdl            @ 5d7cfcca344034aff9327f77fc181ae3754e7a90
    third_party/externals/angle2         @ b001528ffa00e7c15a5002124f707570e59a5697
    third_party/externals/swiftshader    @ cbb80f5f0078a9941f3ec43e83e52c3d15a43bea
    third_party/externals/icu            @ ec9c1133693148470ffe2e5e53576998e3650c1d
    third_party/externals/libpng         @ v1.6.33
    ERROR at //gn/BUILD.gn:6:1: Script returned non-zero exit code.
    exec_script("xamarin_inject_compat.py", [ rebase_path("..") ])
    ^----------
    Current dir: /home/david/.esy/3____________________________________________________________________/b/esy_skia-9d146d11/out/Static/
    Command: python -- /home/david/.esy/3____________________________________________________________________/b/esy_skia-9d146d11/gn/xamarin_inject_compat.py /home/david/.esy/3____________________________________________________________________/b/esy_skia-9d146d11
    Returned 1.
    stderr:

    Traceback (most recent call last):
      File "/home/david/.esy/3____________________________________________________________________/b/esy_skia-9d146d11/gn/xamarin_inject_compat.py", line 26, in <module>
        with file(af, 'r') as original:
    NameError: name 'file' is not defined

    See //gn/BUILDCONFIG.gn:260:3: which caused the file to be included.
      "//gn:warnings_except_public_headers",
      ^------------------------------------
    error: command failed: 'bash' './esy/build.sh' 'linux' '/home/david/.esy/3____________________________________________________________________/i/esy_libjpeg_turbo-9be23a38' (exited with 255)
    esy-build-package: exiting with errors above...

  building esy-skia@github:revery-ui/esy-skia#5535b6979ee66cebf950c60b6f157d84b15e1e70
esy: exiting due to errors above

This is still a Python 2 vs Python 3 issue.

Right! I just checked and it seems like we have some python scripts that were not there anymore in upstream, which is why the cherry-pick wasn't enough to make all our files compatible. I'll try to get back to this later tonight to replace the remaining incompatibilities.

If you have the time, feel free to also try your luck. Might be even easier for you since you have python 3 running on your machine. You can also reference a local version of esy-skia through a link:../esy-skia (or whatever applies to your directory structure) inside your resolutions.

@dfroger and @justinmoon, can you please give the new PR another try? The corresponding resolution is

    "esy-skia": "revery-ui/esy-skia#1b819c60bb0d1998310abd775a95554d65a39675"

TL;DR: Instead of making all scripts compatible with both Python 2 and 3, this new version will attempt to always use Python 2 and fail if it's not available.

It will also check if python2 would resolve to the required version, so if you don't have Python 2 installed at all, this new version will allow you to fix the situation by installing Python 2 as python2 without making any changes to your existing python binary setup.

Please let me know if that helps!

Should be fixed now, since we picked up @manuhornung 's check for python2. Feel free to open a new issue if that is not the case.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bryphe picture bryphe  路  5Comments

akinsho picture akinsho  路  5Comments

bryphe picture bryphe  路  5Comments

bryphe picture bryphe  路  4Comments

bryphe picture bryphe  路  3Comments