Project

General

Profile

Actions

Feature #9979

closed

Support python3 for in-gate tools

Added by Andy Fiddaman almost 5 years ago. Updated over 3 years 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:
Gerrit CR:
External Bug:

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 1 (0 open1 closed)

Bug #10347: git-pbchk requires more python3 fixesClosedAndy Fiddaman2019-02-06

Actions

Related issues

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

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

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

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

Actions
Related to illumos gate - Bug #10931: BUILDPY2TOOLS and BUILDPY3TOOLS need to be documented in illumos.shClosed2019-05-08

Actions
Actions #1

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

Actions #2

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.

Actions #3

Updated by Andy Fiddaman almost 5 years ago

  • % Done changed from 50 to 90
Actions #4

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.

Actions #5

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>

Actions #6

Updated by Andy Fiddaman over 4 years ago

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

Updated by Joshua M. Clulow over 4 years ago

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

Updated by Andy Fiddaman over 4 years ago

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

Updated by Joshua M. Clulow over 4 years ago

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

Updated by x v over 4 years ago

  • Related to Bug #10931: BUILDPY2TOOLS and BUILDPY3TOOLS need to be documented in illumos.sh added
Actions #11

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>

Actions

Also available in: Atom PDF