Skip to content

Breaking: bump Python from 2.x to 3.x (#15)#23

Merged
vweevers merged 5 commits into
masterfrom
python3
Mar 4, 2022
Merged

Breaking: bump Python from 2.x to 3.x (#15)#23
vweevers merged 5 commits into
masterfrom
python3

Conversation

@vweevers
Copy link
Copy Markdown
Member

As is required for latest node-gyp. Some images already had Python 3 installed, now alpine and centos7-devtoolset7 do too, additionally with the python command linked to python3. Meaning python -V will print a 3.x version number.

On centos7-devtoolset7, Python 2 remains installed because yum relies on it. It can also be accessed as the python2 command.

Replaces #22.

As is required for latest `node-gyp`. Some images already had Python
3 installed, now alpine and centos7-devtoolset7 do too, additionally
with the `python` command linked to `python3`. Meaning `python -V`
will print a 3.x version number.

On centos7-devtoolset7, Python 2 remains installed because `yum`
relies on it. It can also be accessed as the `python2` command.
@vweevers vweevers added the semver-major Changes that break backward compatibility label Feb 27, 2022
@vweevers
Copy link
Copy Markdown
Member Author

Two things to fix: android build is failing (unrelated) and centos has this env var:

PYTHONPATH=/opt/rh/devtoolset-7/root/usr/lib64/python2.7/site-packages:/opt/rh/devtoolset-7/root/usr/lib/python2.7/site-packages

Maybe we should also set PYTHON and/or npm_config_python so that we explicitly pick python3, without room for errors.

@vweevers
Copy link
Copy Markdown
Member Author

The paths in PYTHONPATH don't exist, so that's fine.

As for android, ${CROSS_ROOT}/bin/${CROSS_TRIPLE}-strip no longer exists (again). Neither does ${CROSS_ROOT}/bin/strip. There's a /usr/bin/strip, symlinked to /usr/bin/x86_64-linux-gnu-strip. But I think the right one is ${CROSS_ROOT}/bin/llvm-strip, due to dockcross/dockcross#570.

@vweevers vweevers marked this pull request as draft February 27, 2022 15:07
@vweevers vweevers force-pushed the python3 branch 4 times, most recently from 475da2a to 285ff82 Compare February 27, 2022 17:08
@vweevers
Copy link
Copy Markdown
Member Author

I attempted to add node-gyp tests but that fails on GHA due to permission issues (#10). Likely, the GID/UID doesn't match. Locally those tests do work and I've confirmed that it uses the correct Python version, so that will have to do for now.

@vweevers vweevers marked this pull request as ready for review February 27, 2022 17:12
@vweevers vweevers merged commit 8db7b84 into master Mar 4, 2022
@vweevers vweevers deleted the python3 branch March 4, 2022 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver-major Changes that break backward compatibility

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant