Feature #9979
closedSupport python3 for in-gate tools
100%
Description
A number of tools in gate are written in python. With the approaching end-of-support for python2 and as distributions move towards python3, these should be updated so that they can run under either version.
There should also be a mechanism for selection of which major version of python is used to run these tools during gate builds.
Related issues
Updated by Igor Kozhukhov almost 5 years ago
please use shebang like /usr/bin/python3
distributions can do symbolic links to it with correct local version
Updated by Andy Fiddaman almost 5 years ago
Except that IPS pkg dependency resolution can fail if the explicit version is not in the shebang.
I'm providing `TOOLS_PYTHON` which distributions can set in their .env file if they want to override the shebang.
Updated by Andy Fiddaman almost 5 years ago
- % Done changed from 50 to 90
Review up at: https://www.illumos.org/rb/r/1283/
Updated by Andy Fiddaman almost 5 years ago
By default (if nothing is changed in the .env file) the developer/build/onbld package will gain python3 versions of the onbld modules alongside python2 versions. The tools themselves will continue to have a python2 shebang line. In the future, if a distribution wishes to switch to python3 for the tools, they can set TOOLS_PYTHON=/usr/bin/python3.5 or similar and if they want to stop building and shipping the python2 modules then BUILDPY2TOOLS='#' will achieve that. OmniOS bloody no longer uses python2 for the onbld components.
Testing Notes¶
Tested all modified onbld tools from proto with both python3 and python2, for example:
% python3 proto/root_i386-nd/opt/onbld/bin/git-pbchk -p master Comments: These bug synopses don't match the database entries: Synopsis of 9979 is wrong: should be: 'Support python3 for in-gate tools' is: 'Support python3 for in-gate tools-FRED' % python2 proto/root_i386-nd/opt/onbld/bin/git-pbchk -p master Comments: These bug synopses don't match the database entries: Synopsis of 9979 is wrong: should be: 'Support python3 for in-gate tools' is: 'Support python3 for in-gate tools-FRED'
Did three test builds with BUILDPY2TOOLS='#', BUILDPY3TOOLS='#' and neither set. Inspected developer/build/onbld package contents each time and ran the range of tools against some sample files.
Updated by Electric Monk over 4 years ago
- Status changed from In Progress to Closed
- % Done changed from 90 to 100
git commit ca13eaa51ee900abba73dfb6624e492f7e48863e
commit ca13eaa51ee900abba73dfb6624e492f7e48863e Author: Andy Fiddaman <omnios@citrus-it.co.uk> Date: 2019-01-10T16:09:52.000Z 9979 Support python3 for in-gate tools Reviewed by: Toomas Soome <tsoome@me.com> Reviewed by: Peter Tribble <peter.tribble@gmail.com> Reviewed by: Alexander Pyhalov <apyhalov@gmail.com> Reviewed by: Andrew Stormont <andyjstormont@gmail.com> Approved by: Dan McDonald <danmcd@joyent.com>
Updated by Andy Fiddaman over 4 years ago
- Related to Bug #10225: wsdiff broken after 9979 added
Updated by Joshua M. Clulow over 4 years ago
- Related to Bug #10448: wsdiff explodes on encoding error added
Updated by Andy Fiddaman over 4 years ago
- Related to Bug #10524: wsdiff much slower after move from deprecated commands module added
Updated by Joshua M. Clulow over 4 years ago
- Related to Bug #10525: wsdiff output is not correct for a binary file added
Updated by x v over 4 years ago
- Related to Bug #10931: BUILDPY2TOOLS and BUILDPY3TOOLS need to be documented in illumos.sh added
Updated by Electric Monk over 3 years ago
git commit 129e2373151aaf00a186c957c3bd7c1a17c357f8
commit 129e2373151aaf00a186c957c3bd7c1a17c357f8 Author: Andy Fiddaman <omnios@citrus-it.co.uk> Date: 2020-04-08T00:44:41.000Z 9979 Support python3 for in-gate tools Reviewed by: Toomas Soome <tsoome@me.com> Reviewed by: Peter Tribble <peter.tribble@gmail.com> Reviewed by: Alexander Pyhalov <apyhalov@gmail.com> Reviewed by: Andrew Stormont <andyjstormont@gmail.com> Approved by: Dan McDonald <danmcd@joyent.com>