prebuild / docker-images

Docker images for cross compiling prebuilt binaries for Node.js native addons.
GNU General Public License v3.0
10 stars 7 forks source link

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

Closed vweevers closed 2 years ago

vweevers commented 2 years ago

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.

vweevers commented 2 years ago

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 commented 2 years ago

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 https://github.com/dockcross/dockcross/pull/570.

vweevers commented 2 years ago

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.