-
-
Notifications
You must be signed in to change notification settings - Fork 125
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
feat: [BC] Python 2 for all target platforms #160
Conversation
There is this error: I guess |
This is also an interesting read: the package only does a symlink so we can do this by hand instead. I’m sharing this so we don’t forget about |
Yes indeed. It looks like the package was never created for 18.04, as can be seen on the packages page. I'll update with a symbolic link and do the same for pip/pip3. |
I'm a bit confused after this though. Wasn't the whole point that #6 [4/7] RUN ln -s /usr/bin/python3 /usr/bin/python && ln -s /usr/bin/pip3 /usr/bin/pip
#6 0.220 ln: failed to create symbolic link '/usr/bin/python': File exists
#6 ERROR: executor failed running [/bin/sh -c ln -s /usr/bin/python3 /usr/bin/python && ln -s /usr/bin/pip3 /usr/bin/pip]: exit code: 1 |
So should we just install python as python3 for all images? What do you think. Would it introduce breaking changes? I don't use python often enough to know the conventions very well. Please advise. |
I feel like the transition from python 2 to python 3 has been slow and painful, but I think pointing |
Maybe we should make this the 1.0.0 release then. Because all actions are currently rolling 0.x.x images automatically and this could be a BC for many people potentially. |
Looks like the WebGL builds still expect python 2, so those are failing. We could simply install python 2, and we may reconsider switching to python 3 if Unity updates the version of python that WebGL builds use. Even so, I think moving to 1.0.0 after adding python to the base image is a good idea. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommend this change to install python
(python 2).
The problem is that we use both python2 (for webgl) and python3 (for android and iOS). Those were all added in individual fixes. Does anyone have the right documentation for these Firebase SDKs that are used in games? Perhaps we should go for a per-platform upgrade, or install python3 but not link it to |
I haven't been able to find confirmation, but it seems to me that Firebase (for iOS and Android) expects @dharmeshmp @mastef Maybe one of you can confirm? If so, I think we should be OK to merge this PR and close the corresponding issue. |
That's also what I'm thinking. Except I don't think that we should go from python 3 to python 2. Which is what it would mean for iOS and Android if we merge it in the current state. What about if we just install both (python2 and python3) and link |
WebGL builds expect that |
Yea I'm in favour of that too. |
Not a necessity. The python = python 3 hack can be removed in favor of just
having python 2 installed
AFAIK `apt install python` will install python 2, no?
I would agree with the code in this PR. Am I missing something?
|
I'm not sure if I get your meaning. |
Sure. But I believe you may have missed the past few comments. |
We had the If There does not seem to be any necessity for having python 3 symlinked to python. |
@webbertakken Ok I found your comment. Firebase just needs any python to be available at |
The current code of the PR looks great! |
It's not complete. It has breaking changes for people that were already relying on python 3. As discussed above, In case we introduce breaking changes we'd rather go up than down - maybe with the exception of WebGL which somehow needs python 2 specifically (I think?). Installing python 3 and symbolic linking that would seem like a better forward solution. |
Python 3 is already installed. If somebody needs to use Python 3, they can call The hack we used was to not add another dependency ( python2 ) - but since that is added now for all images, the hack is not needed any longer. Do you have any use-case where Python 3 symlinked to python is needed? Because it's not needed for Firebase. |
This is misinformation. Python 3 is not installed on all images. That's exactly what we've been discussing above your first comment. See also this comment #100 (comment) on the originating issue, from when this threw us off our game the first time. Please read the posts before your first comment on this thread. We have concluded that ubuntu does not install python3 by default. Web target needs python 2, some other platforms include (and require) a python 3 installation instead. And so we have agreed on the following solution: #160 (comment). Please let us know if you have any relevant input or concerns about our proposed solution. |
Co-authored-by: David Finol <[email protected]>
Co-authored-by: David Finol <[email protected]>
Co-authored-by: David Finol <[email protected]>
Confusion about which version is installed
Actually it looks like indeed both python2 and python3 are installed after these changes. To Python3 or not to Python3 Regarding our cc: @mastef |
6aee789
to
9b0148b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reviewed afterward, but it looks good to me. Nice work 😊
* feat: python-is-python3 and move build essentials to base * feat: use manual symlink instead and include pip3 * fix: derp * fix: python already exists * feat: add python install * Apply suggestions from code review Co-authored-by: David Finol <[email protected]> * go back to installing python2 Co-authored-by: David Finol <[email protected]> * remove symlinks Co-authored-by: David Finol <[email protected]> * redistribute installations based on their weight Co-authored-by: David Finol <[email protected]>
Decision
As core maintainers we've considered all options and we've decided to go with the following solution:
python2
for all target platforms (in base image) forUbuntu 18.04
for and releasev1.0.0
, introduce BCUbuntu 20.04
or22.04
becomes recommended byUnity
, we move topython3
and releasev2.0.0
, introducing another BC (we'll need to consider which editor versions will support 20.04)Changes in this PR
Allows using Firebase with all images, by enabling the
python
command, referring topython3
.python
install fromwebgl
andil2cpp
aspython3python2 is already installed on the ubuntu image.Addpython-is-python3
to base image (this is available from ubuntu 20.04 on and not desired in ubuntu 18.04)Movebuild-essential
,clang
from the editor image to the base imagepython-setuptools
from the editor image to the base imagepython
will no longer referencepython3
(butpython2
) on iOS and Android target platform images. We believe this will not break existing projects that make use of Firebase SDK.Fixes: #100
Rationale
Status quo
docker/images/ubuntu/base/Dockerfile
Line 1 in 4e88219
docker/images/ubuntu/editor/Dockerfile
Line 202 in 4e88219
docker/images/ubuntu/editor/Dockerfile
Line 222 in 4e88219
Discussion points
order to stay compatible: "in preparation for an eventual change in the default version of Python, Python 2 only scripts should either be updated to be source compatible with Python 3 or else to use python2 in the shebang line."
Our options
Sources used
Checklist
linux-il2cpp
andwebgl