镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Dependency v8 is not Python 3 compatible #24512

Activity

  1. Trott commented on Nov 26, 2018

    @Trott
    Member

    PR has landed so I assume this can be closed. Comment (or re-open if GitHub allows) if I'm wrong about that! Thanks!!!

  2. refack commented on Nov 26, 2018

    @refack
    Contributor

    PR has landed so I assume this can be closed.

    The files in deps/v8 and tools/inspector_protocol + jinja2 + markupsafe where excluded from #24486. So this is still an issue.

  3. reopened this on Nov 26, 2018
  4. added
    v8 engineIssues and PRs related to the V8 dependency.
    inspectorIssues and PRs related to the V8 inspector protocol.
    pythonPRs and issues that require attention from people who are familiar with Python.
    toolsIssues and PRs related to the tools directory.
    on Nov 26, 2018
  5. refack commented on Nov 26, 2018

    @refack
    Contributor

    /CC @nodejs/v8 @nodejs/v8-inspector

    FTR on 1.1.2020 Python 2 hits it's EOL https://pythonclock.org/

  6. bmsdave commented on Nov 28, 2018

    @bmsdave
    Contributor

    If you do not mind.
    I would like to try to take up this task.
    I'll try it this weekend. If I have any problems, I'll write.

  7. hashseed commented on Nov 28, 2018

    @hashseed
    Member

    I definitely don't mind any contributions here. Do you have a list of scripts required by Node.js that need to be migrated?

  8. cclauss commented on Nov 28, 2018

    @cclauss
    ContributorAuthor

    There are now less that 400 days until the end of life of Python 2 (aka legacy Python). The v8 repo is just 1.4% Python but that is all legacy Python and at least 76 files need to be modified just to fix the print statement which is merely the start of a Python 3 port. v8 is a venerable codebase and I often hear that it has been a godsend to the JavaScript community but its Python code needs to be modernized, removed, or replaced with JavaScript, Go, etc. in the days remain until Python 2 end of life.

    I would recommend that someone uses http://python-future.org to do the following:

    • Run v8 tests on Python 2.7 and make sure they pass
    • Drop commitment to support for all Python versions < 2.7 (they are EOL for 5+ years anyway)
    • Run futurize -f libfuturize.fixes.fix_print_with_import -w . at the root of the v8 repo (print() function and new style imports for Python 3 v8/v8#26)
    • Run v8 tests on Python 2.7 and make sure they pass
    • Run futurize --stage1 -w . at the root of the v8 repo
    • Run v8 tests on Python 2.7 and make sure they pass
    • Run v8 tests on Python 3.7 in allow_failures mode and fix as you go...
  9. bmsdave commented on Nov 28, 2018

    @bmsdave
    Contributor

    Do you have a list of scripts required by Node.js that need to be migrated?

    @hashseed I don't have that list. I was planning on finding it through the codebase. But if you provide it, it will be very cool.

    @cclauss thank you very much for your clear recommendations. I will try to do it and provide for consideration.

  10. alexkozy commented on Nov 28, 2018

    @alexkozy
    Member

    @bmsdave any changes to inspector_protocol should be upstreamed to inspector_protocol repo first. I can help you with it as soon as your are ready.

  11. cclauss commented on Dec 12, 2018

    @cclauss
    ContributorAuthor

    @ak239 @bmsdave @hashseed Some low hanging fruit in the upstream inspector_protocol repo.

    flake8 testing of https://chromium.googlesource.com/deps/inspector_protocol on Python 3.7.1

    ./check_protocol_compatibility.py:478:46: E999 SyntaxError: invalid syntax
                print "  Public changes since %s:" % version
                                                 ^
    ./code_generator.py:43:18: F821 undefined name 'xrange'
            for i in xrange(len(keys)):
                     ^
    ./pdl.py:162:51: E999 SyntaxError: invalid syntax
            print 'Error in %s:%s, illegal token: \t%s' % (file_name, i, line)
                                                      ^
    2     E999 SyntaxError: invalid syntax
    1     F821 undefined name 'xrange'
    3
    
  12. 48 remaining items

  13. bmsdave commented on Oct 28, 2019

    @bmsdave
    Contributor

    How can we solve this problem?

    Will updating v8 to node.js solve it?
    Or can I make changes to this part https://github.com/nodejs/node/tree/master/deps/v8?

  14. cclauss commented on Oct 28, 2019

    @cclauss
    ContributorAuthor

    I think we need @targos and/or @Trott to weigh in on that.

  15. targos commented on Oct 28, 2019

    @targos
    Member

    I don't really consider this a problem, because we don't use the scripts that are not compatible with Python 3.
    If it is fixed at the V8 level (https://github.com/v8/v8), we will inherit that when we upgrade V8.
    The next update will be to version 7.9: #30020

  16. cclauss commented on Oct 28, 2019

    @cclauss
    ContributorAuthor
  17. targos commented on Oct 28, 2019

    @targos
    Member

    It's good that V8 itself is now compatible but other V8-related tools are not.

    See https://ci.nodejs.org/job/node-test-commit-v8-linux/2590/nodes=benchmark-ubuntu1604-intel-64,v8test=v8test/console

    08:09:01 Failed to fetch file gs://chromium-clang-format/942fc8b1789144b8071d3fc03ff0fcbe1cf81ac8 for v8/buildtools/linux64/clang-format. [Err: gsutil requires python 2.6 or 2.7.
    08:09:01 ]
    08:09:01 0> Failed to fetch file gs://chromium-clang-format/942fc8b1789144b8071d3fc03ff0fcbe1cf81ac8 for v8/buildtools/linux64/clang-format, skipping. [Err: gsutil requires python 2.6 or 2.7.
    

    By looking at https://github.com/GoogleCloudPlatform/gsutil, gsutil seems to support Python 3 so maybe the version used by depot_tools is too old?

  18. aduh95 commented on Apr 28, 2020

    @aduh95
    Contributor

    Should this issue stay open? I believe this issue is outdated as Node.js build chain is compatible with Python 3.

  19. jasnell commented on Apr 28, 2020

    @jasnell
    Member

    @nodejs/v8 @nodejs/build ... what do you think? There doesn't seem to be reason to keep this open?

  20. cclauss commented on Apr 28, 2020

    @cclauss
    ContributorAuthor

    This test would crash on Python 3 but that seem like a simple fix that is not on the critical path.

    ./test/debugging/wasm/gdb-server/gdb_rsp.py:35:14: F821 undefined name 'xrange'
        for i in xrange(int(timeout_in_seconds / poll_time_in_seconds)):
                 ^
    ./test/debugging/wasm/gdb-server/gdb_rsp.py:67:8: F821 undefined name 'sys'
        if sys.platform == 'win32':
           ^
    
  21. targos commented on Apr 28, 2020

    @targos
    Member

    The issue is still valid. V8 build tools are not yet all compatible with Python 3:

    $ gclient sync
    Warning: Running gclient on Python 3. 
    If you encounter any issues, please file a bug on crbug.com under the Infra>SDK component.
    Syncing projects: 100% (28/28), done.                                                
    
    ________ running 'vpython v8/third_party/depot_tools/update_depot_tools_toggle.py --disable' in '/home/mzasso/git/chromium/v8'
    [E2020-04-28T19:19:27.955163+02:00 229437 0 annotate.go:241] goroutine 1:
    [E2020-04-28T19:19:27.955189+02:00 229437 0 annotate.go:241] #0 go.chromium.org/luci/vpython/python/find.go:93 - python.Find()
    [E2020-04-28T19:19:27.955199+02:00 229437 0 annotate.go:241]   annotation #0:
    [E2020-04-28T19:19:27.955205+02:00 229437 0 annotate.go:241]     reason: no Python found
    [E2020-04-28T19:19:27.955210+02:00 229437 0 annotate.go:241]   annotation #1:
    [E2020-04-28T19:19:27.955215+02:00 229437 0 annotate.go:241]     reason: could not find appropriate executable for: "python2.7"
    

    I don't know if we should keep this open though, there's nothing we can do about it in Node.js.

  22. mmarchini commented on Apr 28, 2020

    @mmarchini
    Contributor

    IMO that should be tracked upstream, unless Node.js folks are actively working with V8 and Chromium to make the tools Python 3-compatible. Otherwise, as @targos mentioned, there's nothing we can do on our side.

    It's also not a huge deal since it only affects folks building V8 through make-v8, which is limited to a subset of collaborators working on V8 upgrades on Node.js.

  23. cclauss commented on Apr 28, 2020

    @cclauss
    ContributorAuthor

    @targos, What happens when you add the 3??

    vpython3 v8/third_party/depot_tools/update_depot_tools_toggle.py --disable' in '/home/mzasso/git/chromium/v8'
           ^
    
  24. targos commented on Apr 28, 2020

    @targos
    Member

    @cclauss nothing is printed, exits with code 0

  25. ryzokuken commented on Apr 29, 2020

    @ryzokuken
    Contributor

    Agreed with @targos and @mmarchini that this issue should be tracked upstream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    inspectorIssues and PRs related to the V8 inspector protocol.pythonPRs and issues that require attention from people who are familiar with Python.toolsIssues and PRs related to the tools directory.v8 engineIssues and PRs related to the V8 dependency.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions