Cloudstack build fails on EL9 due to Python issue
Hello,
Both 4.17.1 and master (currently 4.18) fail to package/build on EL9 due to a Python error. NB the default Python in EL9 is v3.9, as opposed to 3.6 in EL8. Please advise.
pm ERR! gyp verb check python checking for Python executable "/usr/bin/python3" in the PATH
npm ERR! gyp verb `which` succeeded /usr/bin/python3 /usr/bin/python3
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Command failed: /usr/bin/python3 -c import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack File "<string>", line 1
npm ERR! gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack ^
npm ERR! gyp ERR! stack SyntaxError: invalid syntax
npm ERR! gyp ERR! stack
npm ERR! gyp ERR! stack at ChildProcess.exithandler (node:child_process:399:12)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:520:28)
npm ERR! gyp ERR! stack at maybeClose (node:internal/child_process:1092:16)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
I found a general issue, CloudStack python codebase incl. marvin lib and smoketests etc seem to be Python 3.8 compatible but not Python 3.9 or 3.10 compatible. With Python 3.10 I'm not able to use local marvin tests and run some python/ACS scripts - could it be the same issue building on EL9? cc @DaanHoogland
Releases/EOL reference (from https://www.python.org/downloads/):

@rohityadavcloud , i suspect this issue is due to
7825 verbose node v16.14.0
7826 verbose npm v8.3.1
I tried to downgrade to npm 6.14.17 on a ol9 box, but haven´t managed that yet. I suspect the version of node will be a problem as well. In the end the problem is a line in node-gyp import sys; print "%s.%s.%s" % sys.version_info[:3];, however the node-gyp version mentioned, 7.1.2. and that contains 'import sys; print("%s.%s.%s" % sys.version_info[:3]);'
This is a dependency hell, it seems.
Couldn't we build EL9 pkgs on EL8 container - just asking
I think that would be (almost) the same as installing the el8 packages on el9/ol9. I'll tinker around with that idea. In the end I think we really need to update our dependencies.