Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-50378

Nodejs plugin should allow to force 32bit architecture

    XMLWordPrintable

Details

    Description

      There should be a way to specify that we want to use 32-bit version of node.js on 64-bit version  of windows.

      Attachments

        Activity

          nfalco Nikolas Falco added a comment - - edited

          This is not a bug, it works as design. Plugin get platform and its architecture using the properties given from java executable. If you want force a node to be executed to 32bit than run the agent with 32 JDK.

          nfalco Nikolas Falco added a comment - - edited This is not a bug, it works as design. Plugin get platform and its architecture using the properties given from java executable. If you want force a node to be executed to 32bit than run the agent with 32 JDK.
          nfalco Nikolas Falco added a comment -

          Could you explain me when do you expect run 32 NodeJS?

          Than expose in details how and where do you expect to mark/describe when the system should or must install 32 bit architecture and what's happen on system that does not support 32bit architecture.

          nfalco Nikolas Falco added a comment - Could you explain me when do you expect run 32 NodeJS? Than expose in details how and where do you expect to mark/describe when the system should or must install 32 bit architecture and what's happen on system that does not support 32bit architecture.
          atishay Atishay Jain added a comment - - edited

          We ship code that uses node.js on a desktop that uses native modules. On windows we need both 32-bit and 64-bit windows and we prefer using a single build machine that builds both the versions. We are currently using the manual approach where we specify the download URL to get the 32 bit version while it picks up the 64-bit version automatically.

           

          It would be great if that could be an optional parameter(in the pipeline script). 32 bit versions can be compiled and prepared from 64 bit build machines.

          atishay Atishay Jain added a comment - - edited We ship code that uses node.js on a desktop that uses native modules. On windows we need both 32-bit and 64-bit windows and we prefer using a single build machine that builds both the versions. We are currently using the manual approach where we specify the download URL to get the 32 bit version while it picks up the 64-bit version automatically.   It would be great if that could be an optional parameter(in the pipeline script). 32 bit versions can be compiled and prepared from 64 bit build machines.

          Code changed in jenkins
          User: Nikolas Falco
          Path:
          pom.xml
          src/main/java/jenkins/plugins/nodejs/tools/CPU.java
          src/main/java/jenkins/plugins/nodejs/tools/NodeJSInstaller.java
          src/main/java/jenkins/plugins/nodejs/tools/Platform.java
          src/main/java/jenkins/plugins/nodejs/tools/ToolsUtils.java
          src/main/resources/jenkins/plugins/nodejs/Messages.properties
          src/main/resources/jenkins/plugins/nodejs/Messages_it.properties
          src/main/resources/jenkins/plugins/nodejs/tools/NodeJSInstaller/config.jelly
          src/main/resources/jenkins/plugins/nodejs/tools/NodeJSInstaller/config.properties
          src/test/java/jenkins/plugins/nodejs/tools/NodeJSInstallerTest.java
          src/test/java/jenkins/plugins/nodejs/tools/ToolsUtilsTest.java
          http://jenkins-ci.org/commit/nodejs-plugin/14e5121888d842e5b9679b2f7ae08ddce5cc1588
          Log:
          JENKINS-50378 Add an optional flag that allows to force the installation of a 32bit package of the NodeJS. The flag is allowed only in case a NodeJS package is available for the underlying system and 32bit architecture otherwise the build will fail.

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Nikolas Falco Path: pom.xml src/main/java/jenkins/plugins/nodejs/tools/CPU.java src/main/java/jenkins/plugins/nodejs/tools/NodeJSInstaller.java src/main/java/jenkins/plugins/nodejs/tools/Platform.java src/main/java/jenkins/plugins/nodejs/tools/ToolsUtils.java src/main/resources/jenkins/plugins/nodejs/Messages.properties src/main/resources/jenkins/plugins/nodejs/Messages_it.properties src/main/resources/jenkins/plugins/nodejs/tools/NodeJSInstaller/config.jelly src/main/resources/jenkins/plugins/nodejs/tools/NodeJSInstaller/config.properties src/test/java/jenkins/plugins/nodejs/tools/NodeJSInstallerTest.java src/test/java/jenkins/plugins/nodejs/tools/ToolsUtilsTest.java http://jenkins-ci.org/commit/nodejs-plugin/14e5121888d842e5b9679b2f7ae08ddce5cc1588 Log: JENKINS-50378 Add an optional flag that allows to force the installation of a 32bit package of the NodeJS. The flag is allowed only in case a NodeJS package is available for the underlying system and 32bit architecture otherwise the build will fail.

          Just in case people weren't aware, you can also force 64 bit node to build 32 bit packages by using the "arch" and "target_arch" flags on npm.

          For example, part of my build looks like:

          stage('Windows x86') {
              agent { label 'win-vs2017' }
              tools { nodejs 'NodeJS 8.9.4' }
              environment {
                  npm_config_arch = "ia32"
                  npm_config_target_arch = "ia32"
              }
              steps {
                  bat "npm install"
                  archiveArtifacts '*.zip, *.msi'
              }
          }
          
          peitschie Philip Peitsch added a comment - Just in case people weren't aware, you can also force 64 bit node to build 32 bit packages by using the "arch" and "target_arch" flags on npm. For example, part of my build looks like: stage( 'Windows x86' ) { agent { label 'win-vs2017' } tools { nodejs 'NodeJS 8.9.4' } environment { npm_config_arch = "ia32" npm_config_target_arch = "ia32" } steps { bat "npm install" archiveArtifacts '*.zip, *.msi' } }

          People

            nfalco Nikolas Falco
            atishay Atishay Jain
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: