-
Notifications
You must be signed in to change notification settings - Fork 26.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate engine tools/gn script (and others) to work with Python 3 #83043
Comments
Python 2.7 was end-of-lifed on 2020-01-01. This makes tools/gn compatible with both Python 2.7 and Python 3. Issue: flutter/flutter#83043
Python 2.7 was end-of-lifed on 2020-01-01. This makes tools/gn compatible with both Python 2.7 and Python 3. Issue: flutter/flutter#83043
Python 2.7 was end-of-lifed on 2020-01-01. This makes tools/gn compatible with both Python 2.7 and Python 3. Issue: flutter/flutter#83043
Python 2.7 was end-of-lifed on 2020-01-01. This makes tools/gn compatible with both Python 2.7 and Python 3. Issue: flutter/flutter#83043
In Python 3, subprocess.check_output returns an encoding-independent byte array. If passed universal_newlines=True, both Python 2 and 3 decode and return a UTF-8 string. Issue: flutter/flutter#83043
In Python 3, subprocess.check_output returns an encoding-independent byte array. If passed universal_newlines=True, both Python 2 and 3 decode and return a UTF-8 string. Issue: flutter/flutter#83043
This picks up: flutter/buildroot#461: Update sysroot_ld_path.py for Python3 Issue: flutter/flutter#83043
This picks up: flutter/buildroot#461: Update sysroot_ld_path.py for Python3 Issue: flutter/flutter#83043
This migrates all Python scripts required to build Android targets to be Python 3.x compatible. Main changes: * Communication with processes now returns bytestreams by default. By specifying universal_newlines=True, these streams are decoded as UTF-8. * md5.update() takes a bytes type, but strings are now utf-8 by default. We call string.encode('utf-8') convert to bytes. * print now uses function syntax Issue: flutter/flutter#83043
This migrates all Python scripts required to build Android targets to be Python 3.x compatible. Main changes: * Communication with processes now returns bytestreams by default. By specifying universal_newlines=True, these streams are decoded as UTF-8. * md5.update() takes a bytes type, but strings are now utf-8 by default. We call string.encode('utf-8') convert to bytes. * print now uses function syntax Issue: flutter/flutter#83043
This migrates all checked in Python scripts to run under Python 3.x. Python 2.7 reached end-of-life in January of 2020 and has been removed from may OS distributions at this point. Rolls buildroot to 607277f Issue: flutter/flutter#83043
This migrates all checked in Python scripts to run under Python 3.x. Python 2.7 reached end-of-life in January of 2020 and has been removed from may OS distributions at this point. Rolls buildroot to 607277f Issue: flutter/flutter#83043
This migrates all checked in Python scripts to run under Python 3.x. Python 2.7 reached end-of-life in January of 2020 and has been removed from may OS distributions at this point. Rolls buildroot to 607277f Issue: flutter/flutter#83043
This migrates all checked in Python scripts to run under Python 3.x. Python 2.7 reached end-of-life in January of 2020 and has been removed from may OS distributions at this point. Rolls buildroot to 607277f Issue: flutter/flutter#83043
This migrates all checked in Python scripts to run under Python 3.x. Python 2.7 reached end-of-life in January of 2020 and has been removed from may OS distributions at this point. Rolls buildroot to 607277f Issue: flutter/flutter#83043
This migrates all checked in Python scripts to run under Python 3.x. Python 2.7 reached end-of-life in January of 2020 and has been removed from may OS distributions at this point. Rolls buildroot to 607277f Issue: flutter/flutter#83043
win_tool.py is incompatible with Python 3. This ports Chromium's tool_wrapper.py to our buildroot, but doesn't port their full, updated resource compiler (rc) toolchain. Chromium moved to a model where they wrap rc in an rc.py script and support resource compilation on Win, Mac, and Linux. This adds an additional CIPD dependency that we can avoid. Instead, this ports the ExecRcWrapper implementation from gyp's win_tool.py, with fixes for Python 3. Upstream source: https://chromium.googlesource.com/chromium/src/+/refs/heads/main/build/toolchain/win Replaces gyp win_tool.py: https://chromium.googlesource.com/external/gyp.git/+/refs/heads/master/pylib/gyp/win_tool.py Issue: flutter/flutter#83043
win_tool.py is incompatible with Python 3. This ports Chromium's tool_wrapper.py to our buildroot, but doesn't port their full, updated resource compiler (rc) toolchain. Chromium moved to a model where they wrap rc in an rc.py script and support resource compilation on Win, Mac, and Linux. This adds an additional CIPD dependency that we can avoid. Instead, this ports the ExecRcWrapper implementation from gyp's win_tool.py, with fixes for Python 3. Upstream source: https://chromium.googlesource.com/chromium/src/+/refs/heads/main/build/toolchain/win Replaces gyp win_tool.py: https://chromium.googlesource.com/external/gyp.git/+/refs/heads/master/pylib/gyp/win_tool.py Issue: flutter/flutter#83043
This switches the default script runtime from python/python.exe to python3/python3.exe for all exec_script calls invoked from gn build files. Issue: flutter/flutter#83043
This switches the default script runtime from python/python.exe to python3/python3.exe for all exec_script calls invoked from gn build files. Issue: flutter/flutter#83043
This rolls buildroot to 630be43. Fixes: flutter/flutter#83043
This removes our dependency on gyp. We migrated from gyp to gn more than 5 years ago. The only remaining dependency was on the win_tool.py script in our Windows toolchain rules. That dependency was removed in: flutter/buildroot@ed767ed Bug: flutter/flutter#83043
Migrates all `#!/usr/bin/env python` hashbang lines to use python3. Issue: flutter/flutter#83043
Migrates all `#!/usr/bin/env python` hashbang lines to use python3. Also updates the licence tool to treat python3 scripts on par with python 2 scripts. Issue: flutter/flutter#83043
@safasofuoglu thanks for the update and sorry this slipped off my radar while I focused on some Google internal work. A couple more patches and this migration should be complete. |
Migrates all `#!/usr/bin/env python` hashbang lines to use python3. Also updates the licence tool to treat python3 scripts on par with python 2 scripts. Issue: flutter/flutter#83043
As of flutter/engine#27845, all python scripts in the flutter/engine and flutter/buildroot repos are migrated to Python 3. |
Python 2 has been end-of-life'd since January 2020, all Python scripts on which Flutter depends have been migrated to Python 3. This changes documentation and remaining invocations to explicitly invoke python3. Issue: flutter#83043
Python 2 has been end-of-life'd since January 2020, all Python scripts on which Flutter depends have been migrated to Python 3. This changes documentation and remaining invocations to explicitly invoke python3. Issue: #83043
This is also complete for flutter/flutter as of #87759. |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
This rolls buildroot to 630be43. Fixes: flutter/flutter#83043
This rolls buildroot to 630be43. Fixes: flutter/flutter#83043
Currently, many of the Python scripts in the engine repo, and some of our dependencies, like the Dart SDK, rely on Python 2.7 which was officially end-of-lifed in 2020. We should update our tooling to work with both Python 2.7 and Python 3.
Platform verification:
"python3"
in.gn
in buildroot#!
lines in scripts from python to python3The text was updated successfully, but these errors were encountered: