Project

General

Profile

Feature #9979

Support python3 for in-gate tools

Added by Andy Fiddaman 4 months ago. Updated about 1 month ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
tools - gate/build tools
Start date:
2019-02-06
Due date:
% Done:

100%

Estimated time:
(Total: 0.00 h)
Difficulty:
Medium
Tags:

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.


Subtasks

Bug #10347: git-pbchk requires more python3 fixesClosedAndy Fiddaman

Actions

Related issues

Related to illumos gate - Bug #10225: wsdiff broken after 9979Closed2019-01-12

Actions
Related to illumos gate - Bug #10448: wsdiff explodes on encoding errorClosed2019-02-25

Actions
Related to illumos gate - Bug #10524: wsdiff much slower after move from deprecated commands moduleClosed2019-03-10

Actions
Related to illumos gate - Bug #10525: wsdiff output is not correct for a binary fileClosed2019-03-10

Actions

History

#1

Updated by Igor Kozhukhov 4 months ago

please use shebang like /usr/bin/python3
distributions can do symbolic links to it with correct local version

#2

Updated by Andy Fiddaman 4 months 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.

#3

Updated by Andy Fiddaman 4 months ago

  • % Done changed from 50 to 90
#4

Updated by Andy Fiddaman 4 months 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.

#5

Updated by Electric Monk 2 months 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>

#6

Updated by Andy Fiddaman 2 months ago

  • Related to Bug #10225: wsdiff broken after 9979 added
#7

Updated by Joshua Clulow 28 days ago

  • Related to Bug #10448: wsdiff explodes on encoding error added
#8

Updated by Andy Fiddaman 15 days ago

  • Related to Bug #10524: wsdiff much slower after move from deprecated commands module added
#9

Updated by Joshua Clulow 15 days ago

  • Related to Bug #10525: wsdiff output is not correct for a binary file added

Also available in: Atom PDF