• Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • job-dsl-plugin
    • None
    • Jenkins 1.646
      Custom Tools Plugin 0.4.4
      Matrix Project Plugin 1.6

      When using customTools plugin, I export the installation path by putting them in "Exported paths". But these paths don't appear later in PATH in matrixjobs, while it works fine in freestylejobs.

      My installer configuration is :

      Name: phpenv
      Exported paths; phpenv/bin,phpenv/shims
      Command :
      ```
      export PHPENV_ROOT=$(pwd)/phpenv
      export PATH="$PATH:$PHPENV_ROOT/bin"

      (
      if ! flock --exclusive --nonblock 9; then
      flock --exclusive 9
      exit 1
      fi

      if test -d $PHPENV_ROOT; then
      echo 'phpenv installed'
      else
      curl -L http://git.io/phpenv-installer | bash
      fi

      if ! test -d $PHPENV_ROOT/shims; then
      mkdir $PHPENV_ROOT/shims
      fi
      ) 9>phpenv.lock

      eval "$(phpenv init -)"
      ```

      My Job configuration is

      Axis config:
      Name: PHP_VERSION
      Value: 5.3.29 5.4.45 5.5.30

      Build config:
      ```
      phpenv versions | grep ${PHP_VERSION} || phpenv install ${PHP_VERSION}
      ```

      In the building process, I got 'phpenv not found' error and reason is the installation path is not in $PATH.

          [JENKINS-32739] Unable to export path in matrix jobs.

          Joshua Spence added a comment -

          Yeah, I'm seeing this issue as well. Could it be related to JENKINS-32724?

          Joshua Spence added a comment - Yeah, I'm seeing this issue as well. Could it be related to JENKINS-32724 ?

          Joshua Spence added a comment -

          I put a shell step into the job which ran `env`. Looking at the output, `$PATH` does not seem to be set correctly (notice the `::`):

          ```
          PATH=/mnt/jenkins-slave-workspace/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/arcanist:/mnt/jenkins-slave-workspace/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/arcanist/arcanist/bin::/home/jenkins-slave/.composer/vendor/bin:/home/jenkins-slave/.composer/vendor/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/jenkins-slave/.rvm/bin:/home/jenkins-slave/.rvm/bin:/home/jenkins-slave/.rvm/bin:/home/jenkins-slave/.rvm/bin:/home/jenkins-slave/.composer/vendor/bin:/home/jenkins-slave/.composer/vendor/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/jenkins-slave/.rvm/bin:/home/jenkins-slave/.rvm/bin:/home/jenkins-slave/.rvm/bin:/home/jenkins-slave/.rvm/bin
          ```

          Joshua Spence added a comment - I put a shell step into the job which ran `env`. Looking at the output, `$PATH` does not seem to be set correctly (notice the `::`): ``` PATH=/mnt/jenkins-slave-workspace/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/arcanist:/mnt/jenkins-slave-workspace/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/arcanist/arcanist/bin::/home/jenkins-slave/.composer/vendor/bin:/home/jenkins-slave/.composer/vendor/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/jenkins-slave/.rvm/bin:/home/jenkins-slave/.rvm/bin:/home/jenkins-slave/.rvm/bin:/home/jenkins-slave/.rvm/bin:/home/jenkins-slave/.composer/vendor/bin:/home/jenkins-slave/.composer/vendor/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/jenkins-slave/.rvm/bin:/home/jenkins-slave/.rvm/bin:/home/jenkins-slave/.rvm/bin:/home/jenkins-slave/.rvm/bin ```

          Joshua Spence added a comment -

          Ah interesting... it may be because we are using two custom tools in the same job. If I remove the first custom tool then it works as expected.

          Joshua Spence added a comment - Ah interesting... it may be because we are using two custom tools in the same job. If I remove the first custom tool then it works as expected.

          Joshua Spence added a comment -

          OK, so this doesn't work:

          ```
          <com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper>
          <selectedTools>
          <com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper_-SelectedTool>
          <name>arcanist</name>
          </com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper_-SelectedTool>
          </selectedTools>
          <multiconfigOptions>
          <skipMasterInstallation>false</skipMasterInstallation>
          </multiconfigOptions>
          <convertHomesToUppercase>false</convertHomesToUppercase>
          </com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper>
          <com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper>
          <selectedTools>
          <com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper_-SelectedTool>
          <name>phpenv</name>
          </com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper_-SelectedTool>
          </selectedTools>
          <multiconfigOptions>
          <skipMasterInstallation>false</skipMasterInstallation>
          </multiconfigOptions>
          <convertHomesToUppercase>false</convertHomesToUppercase>
          </com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper>
          ```

          But this does work:

          ```
          <com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper>
          <selectedTools>
          <com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper_-SelectedTool>
          <name>arcanist</name>
          </com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper_-SelectedTool>
          <com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper_-SelectedTool>
          <name>phpenv</name>
          </com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper_-SelectedTool>
          </selectedTools>
          <multiconfigOptions>
          <skipMasterInstallation>false</skipMasterInstallation>
          </multiconfigOptions>
          <convertHomesToUppercase>false</convertHomesToUppercase>
          </com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper>
          ```

          Joshua Spence added a comment - OK, so this doesn't work: ``` <com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper> <selectedTools> <com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper_-SelectedTool> <name>arcanist</name> </com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper_-SelectedTool> </selectedTools> <multiconfigOptions> <skipMasterInstallation>false</skipMasterInstallation> </multiconfigOptions> <convertHomesToUppercase>false</convertHomesToUppercase> </com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper> <com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper> <selectedTools> <com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper_-SelectedTool> <name>phpenv</name> </com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper_-SelectedTool> </selectedTools> <multiconfigOptions> <skipMasterInstallation>false</skipMasterInstallation> </multiconfigOptions> <convertHomesToUppercase>false</convertHomesToUppercase> </com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper> ``` But this does work: ``` <com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper> <selectedTools> <com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper_-SelectedTool> <name>arcanist</name> </com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper_-SelectedTool> <com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper_-SelectedTool> <name>phpenv</name> </com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper_-SelectedTool> </selectedTools> <multiconfigOptions> <skipMasterInstallation>false</skipMasterInstallation> </multiconfigOptions> <convertHomesToUppercase>false</convertHomesToUppercase> </com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper> ```

          Oleg Nenashev added a comment - - edited

          joshuaspence
          How have you managed to add two instances of the Build Wrapper into your job configuration?
          AFAIK Jenkins core is not designed in such way, and the plugin also won't work correctly with such configuration.
          Have you edited the config.xml file manually?

          Oleg Nenashev added a comment - - edited joshuaspence How have you managed to add two instances of the Build Wrapper into your job configuration? AFAIK Jenkins core is not designed in such way, and the plugin also won't work correctly with such configuration. Have you edited the config.xml file manually?

          Joshua Spence added a comment -

          Using the job-dsl-plugin

          Joshua Spence added a comment - Using the job-dsl-plugin

          Oleg Nenashev added a comment -

          wjiang And what about you?

          Oleg Nenashev added a comment - wjiang And what about you?

          Wenzheng Jiang added a comment - - edited

          Same situation here.

          Below dsl code can generate the "incorrect" xml

          customtools['arcanist'] 
          customtools['phpenv']
          

          Where

          customtools['arcanist', 'phpenv'] 
          

          generates the "correct" xml.

          Wenzheng Jiang added a comment - - edited Same situation here. Below dsl code can generate the "incorrect" xml customtools[ 'arcanist' ] customtools[ 'phpenv' ] Where customtools[ 'arcanist' , 'phpenv' ] generates the "correct" xml.

          Oleg Nenashev added a comment -

          So it's not a bug in Custom Tools Plugin.
          Passing it to daspilker. Maybe he accepts it as an improvement to JobDSL

          Oleg Nenashev added a comment - So it's not a bug in Custom Tools Plugin. Passing it to daspilker . Maybe he accepts it as an improvement to JobDSL

          Yep, thanks.

          Wenzheng Jiang added a comment - Yep, thanks.

            jamietanna Jamie Tanna
            wjiang Wenzheng Jiang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: