Open markdirish opened 3 years ago
I think we need to check to see what process.platform()
will return when Node.js itself is built with a Python which no longer claims to be AIX. I suspect building Node.js this way will cause process.platform()
to return "os400", but I'm not sure. In that case, we would want everything to be consistent. Additionally, we'd probably want to be tagged with "os400" for consistency with output of uname
, process.platfform()
, os.type()
, etc... (as much as it would be nice to use the newer marketing name, lots of other platforms have similar baggage eg. mvs, sunos, win32, ...)
Output from our Python 3.9 build:
bash-5.1$ python --version
Python 3.9.6
bash-5.1$ python
Python 3.9.6 (default, Jul 7 2021, 13:29:52)
[GCC 6.3.0] on os400
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.name
'posix'
>>> import platform
>>> platform.system()
'OS400'
IBM i is a business operating system that includes an AIX-like environment called PASE. Until recently, Python on IBM i identified the operating system as
aix
. Python is used when building the Node.js binary to determine the operating system, so the Node.jsprocess.platform
on when called on IBM i returnsaix
.The problem arises when
node-pre-gyp
usesprocess.platform
in the creation of published package names. This means binaries built on IBM i for IBM i have names that identify the platform asaix
like so:odbc-v2.4.0-aix-ppc64-napi-v6.tar.gz
. IBM i binaries won't run on AIX, and vice-versa, so anyone using AIX to download these packages will get binaries not built for their systems.Extra logic should be added to
lib/util/versioning.js
to check the return value ofos.type()
when the platform is identified as AIX.os.type()
on IBM i will return'OS400'
(the historical name for the operating system), which will allow node-pre-gyp to differentiate between AIX and IBM i. Ifop.type()
returns'OS400'
, then the platform and target_platform should be changed toibmi
.