nodejs / node

Node.js JavaScript runtime ✨🐢🚀✨
https://nodejs.org
Other
107.67k stars 29.64k forks source link

Dependency v8 is not Python 3 compatible #24512

Closed cclauss closed 4 years ago

cclauss commented 5 years ago

The open bug reports on chromium.org:

@bmsdave commit to upstream: https://github.com/nodejs/node/issues/24512#issuecomment-460586513

cclauss commented 5 years ago

Reopening. We need to vendor in a new copy of deps/v8

bmsdave commented 5 years ago

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?

cclauss commented 5 years ago

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

targos commented 5 years ago

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: https://github.com/nodejs/node/pull/30020

cclauss commented 5 years ago

https://github.com/v8/v8 passes these tests.

targos commented 5 years ago

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?

aduh95 commented 4 years ago

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

jasnell commented 4 years ago

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

cclauss commented 4 years ago

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':
       ^
targos commented 4 years ago

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.

mmarchini commented 4 years ago

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.

cclauss commented 4 years ago

@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'
       ^
targos commented 4 years ago

@cclauss nothing is printed, exits with code 0

ryzokuken commented 4 years ago

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