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

cmake plugin install from archive paths are wrong

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • cmakebuilder-plugin
    • None
    • docker jenkins/jenkins:lts

    Description

      When using a cmake that is installed from an archive, the paths for cmake/ctest/cpack are wrong.

      I am using a local build of cmake with the same file structure as the cmake.org archives - contains cmake-blah-version-os-arch/bin/cmake. To illustrate this problem, the example uses the cmake.org archive urls.

      1. run jenkins/jenkins:lts, install common plugins plus Cmake
      2. on configureTools define cmake instance 'cmake-org':
        1. use install 'Extract .zip/.tar.gz'
        2. url of archive on cmake.org (https://cmake.org/files/v3.11/cmake-3.11.3-win64-x64.zip)
        3. Subdirectory of extracted archive 'cmake-3.11.3-win64-x64/bin'
      3. create pipeline job:
      node('cmake&&win64'){
          bat 'type NUL 1>CMakeLists.txt' // "IOException workspace doesn't exist"
          def cmakeTool = tool 'cmake-org'
          echo "tool says ${cmakeTool}"
          cmake arguments: '-V', installation: 'cmake-org'
      }
      

       

      The paths are wrong:

      • The 'tool' step gives the dirname(cmake)
      • 'cmake' step tries to exec "<jenkinshome>/jenkins\tools\hudson.plugins.cmake.CmakeTool\cmake-org\cmake-3.11.3-win64-x64\cmake -V" - 'bin/' is missing
      • dirname(cmake) is not added to PATH - not sure if this is expected

      Attachments

        Activity

          15knots Martin Weber added a comment -

          dirname(cmake) is not added to PATH - not sure if this is expected

          This is expected: Pipeline does not support to add envvars to pipeline scope.

          BTW: May I ask why you don not just use 'Download from cmake.org' as the installer? That will download a version of cmake that is suitable to the node`s OS and CPU architecture.

          15knots Martin Weber added a comment - dirname(cmake) is not added to PATH - not sure if this is expected This is expected: Pipeline does not support to add envvars to pipeline scope. BTW: May I ask why you don not just use 'Download from cmake.org' as the installer? That will download a version of cmake that is suitable to the node`s OS and CPU architecture.
          tlynchpin Tim Lynch added a comment -

          I am using a local build of cmake that is in local artifact repository, using the "Extract" installer. For repro purpose the best analog is using the urls of the cmake archives.

          An alternate use case would be an agent w/o internet access that can get the cmake.org archives via a local http service.

           

          tlynchpin Tim Lynch added a comment - I am using a local build of cmake that is in local artifact repository, using the "Extract" installer. For repro purpose the best analog is using the urls of the cmake archives. An alternate use case would be an agent w/o internet access that can get the cmake.org archives via a local http service.  
          15knots Martin Weber added a comment -

          Please close after you verified it

          15knots Martin Weber added a comment - Please close after you verified it
          markewaite Mark Waite added a comment -

          Prior to cmakebuilder release 2.6.0 I included "cmake-3.0.2-Linux-i386/bin/cmake" as the "subdir" argument of the tool definition. I always thought that was strange since "bin/cmake" is not a subdir.

          With the release of cmakebuilder 2.6.0, the subdir of the tool definition now needs to be "cmake-3.0.2-Linux-i386/bin". That is a nice fix. Thanks!

          markewaite Mark Waite added a comment - Prior to cmakebuilder release 2.6.0 I included "cmake-3.0.2-Linux-i386/bin/cmake" as the "subdir" argument of the tool definition . I always thought that was strange since "bin/cmake" is not a subdir. With the release of cmakebuilder 2.6.0, the subdir of the tool definition now needs to be "cmake-3.0.2-Linux-i386/bin". That is a nice fix. Thanks!
          tlynchpin Tim Lynch added a comment -

          looks good, thanks

          tlynchpin Tim Lynch added a comment - looks good, thanks

          People

            15knots Martin Weber
            tlynchpin Tim Lynch
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: