Bug 13583

Summary: Make /usr/bin/python an alternatives?
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Ross Burton <ross.burton>
Component: devtools / tool chainAssignee: Ross Burton <ross.burton>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: Medium+ CC: bunk, meta.mr.watcher, meta.watcher, randy.macleod
Version: 3.0   
Target Milestone: 3.1 M3   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

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.