Bug 13583 - Make /usr/bin/python an alternatives?
Summary: Make /usr/bin/python an alternatives?
Status: RESOLVED WONTFIX
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: devtools / tool chain (show other bugs)
Version: 3.0
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 3.1 M3
Assignee: Ross Burton
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2019-10-08 13:21 UTC by Ross Burton
Modified: 2020-01-29 16:32 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ross Burton 2019-10-08 13:21:30 UTC
If you just install python3 in an image, there is no /usr/bin/python binary because that is only shipped by python (2).

We should probably install that using alternatives instead.  Default to python2 for now, and migrate to py3 later.
Comment 1 Adrian Bunk 2019-10-08 14:18:56 UTC
(In reply to comment #0)
> If you just install python3 in an image, there is no /usr/bin/python binary
> because that is only shipped by python (2).

While a change to PEP 394 just 3 months ago removed the wording that /usr/bin/python should not point to python3,[1] some distributions like Debian/Ubuntu might never provide a python -> python3 symlink.

[1] https://github.com/python/peps/commit/ae932bd6fd2c493d7d64ce328a5293bac4c48884

> We should probably install that using alternatives instead.  Default to
> python2 for now, and migrate to py3 later.

With python3 installed, this would give a different python depending on whether or not there is some recipe from some layer installed that pulls in python2.

And "migrate to py3 later" would then break all recipes in layers that ship python2 scripts with #!/usr/bin/python shebangs.
Comment 2 Ross Burton 2020-01-29 16:32:42 UTC
What Adrian said makes sense.