Bugs: |
|
---|
9979 Support python3 for in-gate tools
Review Request #1283 — Created Nov. 14, 2018 and submitted
Information | |
---|---|
citrus | |
illumos-gate | |
master | |
9979 | |
2a85fda... | |
Reviewers | |
general | |
9979 Support python3 for in-gate tools
This change relates to the onbld tools which are written in python such as
git-pbchk
andwsdiff
. It:
-
enables the building of python3 versions of onbld modules providing
BUILDPY3TOOLS
is not set to an octothorpe; -
allows the python2 modules to be omitted from the onbld package via
BUILDPY2TOOLS='#'
; -
Provides a variable through which the default interpreter (shebang) for these can be set -
TOOLS_PYTHON
- which defaults to$(PYTHON)
(or$(PYTHON3)
ifBUILDPY2TOOLS='#'
)
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
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.
-
-
usr/src/data/locale/tools/mkwidths.py (Diff revision 1) Can this be moved to the other copyright statement?
-
Testing Done: |
|
---|
-
-
usr/src/pkg/manifests/developer-build-onbld.mf (Diff revision 1) Do I understand correctly that before this change python-35 was not hardcoded in manifest?
Should we introduce one more parameter to make switching 3.5->3.x more transparent?
-
Using the same toggles to enable/disable the tools as the gate components is wrong; distributions (Tribblix for one) may legitimately wish to have the tools but disable the artefacts coming from the gate.
Change Summary:
- Use new
BUILDPY2TOOLS
andBUILDPY3TOOLS
variables to control building of tool modules (thanks ptribble); - Replace hard-coded 3.5 and -35 in manifest with variables (thanks alp);
- Fix problems when checking files containing non-ASCII characters found during further testing;
- Add missing copyrights and some small whitespace fixes to satisfy pbchk.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 2 (+1030 -476) |
Change Summary:
Automatically set TOOLS_PYTHON to $(PYTHON3) if BUILDPY2TOOLS='#'
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 3 (+1031 -476) |
Change Summary:
Updating test notes to reflect new switch variable names and record additional testing.
Testing Done: |
|
---|
-
I'm not familiar enough with the innards of python to evaluate the python changes, bu structurally this now looks fine.
-
-
usr/src/tools/scripts/git-pbchk.py (Diff revision 3) How will it behave if run outside of git repository?
Change Summary:
Re-based on master and updated so that the build works properly if PYTHON_VERSION etc. are set explicitly in the .env file
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 4 (+1039 -480) |