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

cmakebuilder should allow cmake scripting

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      it would be desirable for full cross-platform scripting of bigger cmake-projects to be able to run cmake scripts (cmake -P <script file>).

      This is not possible at the moment as the plugin fails the build if it doesn't find a CMakeCache,txt, so even though the script file specified with a -P command-line option runs properly, the build will always fail.

      Even though it would be possible to launch cmake via a shell command, this is not desirable as it requires cmake to be in the PATH of the build slave, creating conflicts as soon as multiple cmake installation are present. I believe it would be advantageous if the CMake tool configuration could be reused for this.

        Attachments

          Activity

          Hide
          15knots Martin Weber added a comment -

          Do I understand correctly:
          cmakebuilder-plugin should provide a new kind of build-step which just invokes cmake with arbitrary arguments, but is not focused on generating build scripts?
          Of course, re-using the existing cmake auto-installer would make sense.

          Show
          15knots Martin Weber added a comment - Do I understand correctly: cmakebuilder-plugin should provide a new kind of build-step which just invokes cmake with arbitrary arguments, but is not focused on generating build scripts? Of course, re-using the existing cmake auto-installer would make sense.
          Hide
          jorgziegler Jörg Ziegler added a comment -

          absolutely. Actually the idea to having a new kind of build step sounds brilliant as an idea of how to implement it practically.

          In my mind there are two ways that cmake could be invoked:

          1. in script mode: -P <file>
          2. in command mode (-E) where a series of commands are executed. The commands could be specified in the jenkins project.

          I don't understand your reference to the 'existing cmake auto-installer' - could you please elaborate?

          Show
          jorgziegler Jörg Ziegler added a comment - absolutely. Actually the idea to having a new kind of build step sounds brilliant as an idea of how to implement it practically. In my mind there are two ways that cmake could be invoked: in script mode: -P <file> in command mode (-E) where a series of commands are executed. The commands could be specified in the jenkins project. I don't understand your reference to the 'existing cmake auto-installer' - could you please elaborate?
          Hide
          15knots Martin Weber added a comment - - edited

          'existing cmake auto-installer' : The plugin is able to download cmake from cmake.org and install it, if configured so.

          Show
          15knots Martin Weber added a comment - - edited 'existing cmake auto-installer' : The plugin is able to download cmake from cmake.org and install it, if configured so.
          Hide
          15knots Martin Weber added a comment -

          For the new build-step which just invokes cmake, I would suggest users should be able to configure the following

          1. Which cmake installation should be used
          2. Arbitrary arguments, in a text field. One argument per line, so users will not have to worry about quotation.
          3. Working directory for cmake?
          4. An option to ignore the exit status of cmake?

          Both arguments and working dir should handle $VARIABLE expansion.

          Show
          15knots Martin Weber added a comment - For the new build-step which just invokes cmake, I would suggest users should be able to configure the following Which cmake installation should be used Arbitrary arguments, in a text field. One argument per line, so users will not have to worry about quotation. Working directory for cmake? An option to ignore the exit status of cmake? Both arguments and working dir should handle $VARIABLE expansion.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: 15knots
          Path:
          src/main/java/hudson/plugins/cmake/CToolBuilder.java
          src/main/resources/hudson/plugins/cmake/CToolBuilder/config.jelly
          src/main/resources/hudson/plugins/cmake/CToolBuilder/help-arguments.html
          src/main/resources/hudson/plugins/cmake/CToolBuilder/help-workingDir.html
          src/main/resources/hudson/plugins/cmake/CToolBuilder/help.html
          src/test/java/hudson/plugins/cmake/CmakeBuilderBuildTest.java
          http://jenkins-ci.org/commit/cmakebuilder-plugin/5a0d98854fa41c24306fcfa74fd7ef69c09827f1
          Log:
          JENKINS-32657, JENKINS-30695: Added build step to invoke any tool of the
          CMake suite with arbitrary arguments

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: 15knots Path: src/main/java/hudson/plugins/cmake/CToolBuilder.java src/main/resources/hudson/plugins/cmake/CToolBuilder/config.jelly src/main/resources/hudson/plugins/cmake/CToolBuilder/help-arguments.html src/main/resources/hudson/plugins/cmake/CToolBuilder/help-workingDir.html src/main/resources/hudson/plugins/cmake/CToolBuilder/help.html src/test/java/hudson/plugins/cmake/CmakeBuilderBuildTest.java http://jenkins-ci.org/commit/cmakebuilder-plugin/5a0d98854fa41c24306fcfa74fd7ef69c09827f1 Log: JENKINS-32657 , JENKINS-30695 : Added build step to invoke any tool of the CMake suite with arbitrary arguments
          Hide
          jorgziegler Jörg Ziegler added a comment -

          awesome, thank you Martin!

          Show
          jorgziegler Jörg Ziegler added a comment - awesome, thank you Martin!
          Hide
          jorgziegler Jörg Ziegler added a comment -

          Martin Weber - note that there is a small issue when deploying the update, and that is that the tagnames for cmakeArgs and buildDir have changed (to toolArgs and workingDir).
          Upon upgrading the plug-in theses aren't automatically renamed, thereby breaking the job and making jenkins complain that there is old data.

          Manually changing the tags seems to work fine.

          Thought this might be a blocker for some people so it would be worth mentioning.

          Show
          jorgziegler Jörg Ziegler added a comment - Martin Weber - note that there is a small issue when deploying the update, and that is that the tagnames for cmakeArgs and buildDir have changed (to toolArgs and workingDir). Upon upgrading the plug-in theses aren't automatically renamed, thereby breaking the job and making jenkins complain that there is old data. Manually changing the tags seems to work fine. Thought this might be a blocker for some people so it would be worth mentioning.
          Hide
          15knots Martin Weber added a comment -

          Thanks for reporting the cmakeArgs/toolArgs issue.
          This is serious, as it causes existing buildsteps to forget part of their configuration.
          I´ll prepare a fix ASAP.

          Show
          15knots Martin Weber added a comment - Thanks for reporting the cmakeArgs/toolArgs issue. This is serious, as it causes existing buildsteps to forget part of their configuration. I´ll prepare a fix ASAP.
          Hide
          15knots Martin Weber added a comment -

          Existing build steps will loose their cmake-argument and working dir settings.

          Show
          15knots Martin Weber added a comment - Existing build steps will loose their cmake-argument and working dir settings.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: 15knots
          Path:
          src/main/java/hudson/plugins/cmake/AbstractCmakeBuilder.java
          src/main/java/hudson/plugins/cmake/CmakeBuilder.java
          http://jenkins-ci.org/commit/cmakebuilder-plugin/7d548881b1b7b91c61b9dfd4b61ebfb5bd23ccb5
          Log:
          FIXED JENKINS-32657: (Reopened) Existing build steps will loose their
          cmake-argument and working directory settings.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: 15knots Path: src/main/java/hudson/plugins/cmake/AbstractCmakeBuilder.java src/main/java/hudson/plugins/cmake/CmakeBuilder.java http://jenkins-ci.org/commit/cmakebuilder-plugin/7d548881b1b7b91c61b9dfd4b61ebfb5bd23ccb5 Log: FIXED JENKINS-32657 : (Reopened) Existing build steps will loose their cmake-argument and working directory settings.
          Hide
          jorgziegler Jörg Ziegler added a comment -

          thanks for the quick fix. Now that I had already renamed the tags manually, is it safe to upgrade to 2.4.1?

          Show
          jorgziegler Jörg Ziegler added a comment - thanks for the quick fix. Now that I had already renamed the tags manually, is it safe to upgrade to 2.4.1?
          Hide
          15knots Martin Weber added a comment -

          It is safe.
          The fix in 2.4.1 just renames the tags, nothing more

          Show
          15knots Martin Weber added a comment - It is safe. The fix in 2.4.1 just renames the tags, nothing more

            People

            Assignee:
            15knots Martin Weber
            Reporter:
            jorgziegler Jörg Ziegler
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: