Migrate to python3

703 views
Skip to first unread message

XING WANG

unread,
Jan 19, 2020, 11:24:55 AM1/19/20
to Android Building
We found AOSP cant not build successfully without python2

Is there a plan to switch to a pure python3 environment ?

We are evaluating whether we can switch the build server to ubuntu 20.04 which without python2 support  in the near future.


Dan Willemsen

unread,
Jan 21, 2020, 2:24:12 AM1/21/20
to Android Building
There are no current plans to switch everything over to python3. We provide our own prebuilt of python2 (in prebuilts/build-tools/path/linux-x86/python2 -> prebuilts/build-tools/linux-x86/bin/py2-cmd), so that script you linked should continue working even if you remove python2 from your host.

(I'm still working on getting a fully functional python3 prebuilt, so we'll still use the host for that, I should have that done for the next release).

Let me know if you see failures on 20.04 without python2, it's possible there are some scripts hardcoding /usr/bin/python[2] still.

- Dan

--
--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to android-...@googlegroups.com
To unsubscribe from this group, send email to
android-buildi...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

---
You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-buildi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-building/afa2ada5-0bea-41dd-a7ab-eb3a7c8b7e7d%40googlegroups.com.

XING WANG

unread,
Jan 21, 2020, 11:23:40 AM1/21/20
to Android Building
Thanks Dan, 

Please let me clarify further. 

So AOSP will not modify all python2 in the build script to be python3 compatible(like dict.iteritems), and we should build AOSP with python2,  If the host does not have python2(20.04), we can use AOSP prebuilt python2.

As far as I know, AOSP uses host python to build  and uses the prebuilt version to do some testing
Will you change soong_ui to set AOSP build with prebuilt python2?


On Tuesday, January 21, 2020 at 3:24:12 PM UTC+8, Dan Willemsen wrote:
There are no current plans to switch everything over to python3. We provide our own prebuilt of python2 (in prebuilts/build-tools/path/linux-x86/python2 -> prebuilts/build-tools/linux-x86/bin/py2-cmd), so that script you linked should continue working even if you remove python2 from your host.

(I'm still working on getting a fully functional python3 prebuilt, so we'll still use the host for that, I should have that done for the next release).

Let me know if you see failures on 20.04 without python2, it's possible there are some scripts hardcoding /usr/bin/python[2] still.

- Dan

On Sun, Jan 19, 2020 at 8:24 AM XING WANG <raymond...@gmail.com> wrote:
We found AOSP cant not build successfully without python2

Is there a plan to switch to a pure python3 environment ?

We are evaluating whether we can switch the build server to ubuntu 20.04 which without python2 support  in the near future.


--
--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to android-...@googlegroups.com
To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

---
You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-...@googlegroups.com.

Dan Willemsen

unread,
Jan 21, 2020, 1:06:21 PM1/21/20
to Android Building
 If the host does not have python2(20.04), we can use AOSP prebuilt python2.
 
No, even if the host does have python2, we'll be using our prebuilt instead. (Unless someone is explicitly calling /usr/bin/python[2], which would be a bug)

As far as I know, AOSP uses host python to build  and uses the prebuilt version to do some testing 

The Soong python support (for host tools/tests and device tests) uses the python source in external/python/..., not the prebuilt. (The prebuilt is generated from the same sources)

Will you change soong_ui to set AOSP build with prebuilt python2?

That already happened with Android 10 (Q).

- Dan


For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

---
You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-buildi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-building/0cb5a861-f45e-4cea-8cc4-d59c792964f7%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages