XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Python3 support?

    Scheduled Pinned Locked Moved Xen Orchestra
    12 Posts 3 Posters 1.7k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • DanpD Offline
      Danp Pro Support Team
      last edited by

      Python2 is EOL as of 1/1/2020. The python-minimal package is no longer available in newer versions of Ubuntu. Is there a plan to support building from source using Python 3 instead?

      There seems to be an incompatibility with node-gyp and python3. This is what I'm getting when running the initial yarn command --

      root@xoce:/opt/xen-orchestra# yarn
      yarn install v1.22.4
      [1/5] Validating package.json...
      [2/5] Resolving packages...
      [3/5] Fetching packages...
      info fsevents@1.2.13: The platform "linux" is incompatible with this module.
      info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
      info fsevents@2.1.3: The platform "linux" is incompatible with this module.
      info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
      [4/5] Linking dependencies...
      [5/5] Building fresh packages...
      [6/12] ⢀ argon2
      [-/12] ⢀ waiting...
      [-/12] ⢀ waiting...
      [-/12] ⢀ waiting...
      warning Error running install script for optional dependency: "/opt/xen-orchestra/node_modules/argon2: Command failed.
      Exit code: 1
      Command: node-pre-gyp install --fallback-to-build
      Arguments:
      Directory: /opt/xen-orchestra/node_modules/argon2
      Output:
      node-pre-gyp info it worked if it ends with ok
      node-pre-gyp info using node-pre-gyp@0.13.0
      node-pre-gyp info using node@12.17.0 | linux | x64
      node-pre-gyp WARN Using request for node-pre-gyp https download
      node-pre-gyp info check checked for \"/opt/xen-orchestra/node_modules/argon2/lib/binding/argon2.node\" (not found)
      node-pre-gyp http GET https://github.com/ranisalt/node-argon2/releases/download/v0.25.1/argon2-v0.25.1-node-v72-linux-x64-glibc.tar.gz
      node-pre-gyp http 404 https://github.com/ranisalt/node-argon2/releases/download/v0.25.1/argon2-v0.25.1-node-v72-linux-x64-glibc.tar.gz
      node-pre-gyp WARN Tried to download(404): https://github.com/ranisalt/node-argon2/releases/download/v0.25.1/argon2-v0.25.1-node-v72-linux-x64-glibc.tar.gz
      node-pre-gyp WARN Pre-built binaries not found for argon2@0.25.1 and node@12.17.0 (node-v72 ABI, glibc) (falling back to source compile with node-gyp)
      node-pre-gyp http 404 status code downloading tarball https://github.com/ranisalt/node-argon2/releases/download/v0.25.1/argon2-v0.25.1-node-v72-linux-x64-glibc.tar.gz
      gyp info it worked if it ends with ok
      gyp info using node-gyp@3.8.0
      gyp info using node@12.17.0 | linux | x64
      gyp info ok
      gyp info it worked if it ends with ok
      gyp info using node-gyp@3.8.0
      gyp info using node@12.17.0 | linux | x64
      gyp ERR! configure error
      gyp ERR! stack Error: Can't find Python executable \"python\", you can set the PYTHON env variable.
      gyp ERR! stack     at PythonFinder.failNoPython (/opt/xen-orchestra/node_modules/node-gyp/lib/configure.js:484:19)
      gyp ERR! stack     at PythonFinder.<anonymous> (/opt/xen-orchestra/node_modules/node-gyp/lib/configure.js:406:16)
      gyp ERR! stack     at F (/opt/xen-orchestra/node_modules/which/which.js:68:16)
      gyp ERR! stack     at E (/opt/xen-orchestra/node_modules/which/which.js:80:29)
      gyp ERR! stack     at /opt/xen-orchestra/node_modules/which/which.js:89:16
      gyp ERR! stack     at /opt/xen-orchestra/node_modules/isexe/index.js:42:5
      gyp ERR! stack     at /opt/xen-orchestra/node_modules/isexe/mode.js:8:5
      gyp ERR! stack     at FSReqCallback.oncomplete (fs.js:167:21)
      gyp ERR! System Linux 5.4.0-33-generic
      gyp ERR! command \"/usr/local/bin/node\" \"/opt/xen-orchestra/node_modules/node-gyp/bin/node-gyp.js\" \"configure\" \"--fallback-to-build\" \"--module=/opt/xen-orchestra/node_modules/argon2/lib/binding/argon2.node\" \"--module_name=argon2\" \"--module_path=/opt/xen-orchestra/node_modules/argon2/lib/binding\" \"--napi_version=6\" \"--node_abi_napi=napi\" \"--napi_build_version=0\" \"--node_napi_label=node-v72\"
      gyp ERR! cwd /opt/xen-orchestra/node_modules/argon2
      gyp ERR! node -v v12.17.0
      gyp ERR! node-gyp -v v3.8.0
      gyp ERR! not ok
      node-pre-gyp ERR! build error
      node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /opt/xen-orchestra/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/opt/xen-orchestra/node_modules/argon2/lib/binding/argon2.node --module_name=argon2 --module_path=/opt/xen-orchestra/node_modules/argon2/lib/binding --napi_version=6 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
      node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/opt/xen-orchestra/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
      node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
      node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1021:16)
      node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
      node-pre-gyp ERR! System Linux 5.4.0-33-generic
      node-pre-gyp ERR! command \"/usr/local/bin/node\" \"/opt/xen-orchestra/node_modules/argon2/node_modules/.bin/node-pre-gyp\" \"install\" \"--fallback-to-build\"
      node-pre-gyp ERR! cwd /opt/xen-orchestra/node_modules/argon2
      node-pre-gyp ERR! node -v v12.17.0
      node-pre-gyp ERR! node-pre-gyp -v v0.13.0
      node-pre-gyp ERR! not ok
      

      @olivierlambert @julien-f Any advice?

      1 Reply Last reply Reply Quote 0
      • olivierlambertO Offline
        olivierlambert Vates 🪐 Co-Founder CEO
        last edited by

        I don't think there's any "plans" since XOA is build on top of Debian 10. However, we'll keep an eye on next Debian if it requires some changes.

        Regarding the dep "problem" with Python, I have no idea myself.

        1 Reply Last reply Reply Quote 0
        • DanpD Offline
          Danp Pro Support Team
          last edited by

          Looks like they plan to remove from Debian as well -- https://wiki.debian.org/Python/2Removal

          1 Reply Last reply Reply Quote 0
          • julien-fJ Offline
            julien-f Vates 🪐 Co-Founder XO Team
            last edited by

            We have no definitive plan for now but we'll keep an eye on this (and we are open to PRs).

            FYI, the issue appears to be related to xo-server > hashy > argon2.

            DanpD 1 Reply Last reply Reply Quote 0
            • DanpD Offline
              Danp Pro Support Team @julien-f
              last edited by

              @julien-f Wouldn't upgrading to a newer version of node-gyp resolved this?

              1 Reply Last reply Reply Quote 0
              • julien-fJ Offline
                julien-f Vates 🪐 Co-Founder XO Team
                last edited by

                XO does not depend on node-gyp directly.

                DanpD 1 Reply Last reply Reply Quote 1
                • DanpD Offline
                  Danp Pro Support Team @julien-f
                  last edited by

                  @julien-f From what I can tell, there are two packages that have node-gyp as a dependency, argon2 and node-sass. Is there a way to force the process to use argon2@0.26.1 instead of argon2@0.25.1?

                  1 Reply Last reply Reply Quote 0
                  • julien-fJ Offline
                    julien-f Vates 🪐 Co-Founder XO Team
                    last edited by

                    I'm not familiar with it but you may found a solution there: https://classic.yarnpkg.com/en/docs/selective-version-resolutions/

                    DanpD 1 Reply Last reply Reply Quote 0
                    • DanpD Offline
                      Danp Pro Support Team @julien-f
                      last edited by

                      @julien-f The newer versions of argon2 successfully build with python3. Why not just bump the minimum argon2 package requirements for hashy?

                      1 Reply Last reply Reply Quote 1
                      • julien-fJ Offline
                        julien-f Vates 🪐 Co-Founder XO Team
                        last edited by

                        I'm thinking about it 🙂

                        1 Reply Last reply Reply Quote 2
                        • julien-fJ Offline
                          julien-f Vates 🪐 Co-Founder XO Team
                          last edited by

                          https://github.com/vatesfr/xen-orchestra/commit/1fa42a57538f36583296c63377582422f4a465df

                          0 julien-f committed to vatesfr/xen-orchestra
                          chore(xo-server): update hashy to 0.9.0
                          
                          BREAKING: requires Node >=10.
                          
                          See https://xcp-ng.org/forum/topic/3107/python3-support
                          DanpD 1 Reply Last reply Reply Quote 0
                          • DanpD Offline
                            Danp Pro Support Team @julien-f
                            last edited by

                            @julien-f 😸 👍

                            1 Reply Last reply Reply Quote 0
                            • First post
                              Last post