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

look for MSVC 15.x toolchain

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Not A Defect
    • cmakebuilder-plugin
    • None
    • Windows with MSVC

    Description

      The generators for MSVC require that cl.exe is in the PATH, and the LIB and INCLUDE variables have been set up before invoking cmake. The cmakebuilder plugin cannot do that, so it cannot be used with the standalone toolchain.

      It would be great if the plugin would test whether the prerequisites are given, and look for the toolchain on its own if they are not.

      Attachments

        Issue Links

          Activity

            simonrichter Simon Richter created issue -
            15knots Martin Weber added a comment -

            A workaround for MSVC is described in Martin Kutny`s blog.
            In short, it applies the effect of vcvarsall.bat as follows:

            1. Setup environment variables by running vcvarsall.bat,
            2. write all environment vars to a file,
            3. use the EnvInject Jenkins Plugin to read the file and pass the required variables to the whole build job.
            15knots Martin Weber added a comment - A workaround for MSVC is described in Martin Kutny`s blog . In short, it applies the effect of vcvarsall.bat as follows: Setup environment variables by running vcvarsall.bat , write all environment vars to a file, use the EnvInject Jenkins Plugin to read the file and pass the required variables to the whole build job.

            Code changed in jenkins
            User: 15knots
            Path:
            src/main/resources/hudson/plugins/cmake/CmakeBuilder/help-generator.html
            http://jenkins-ci.org/commit/cmakebuilder-plugin/bfe1506a258e61d1fa6ed1a8905d7317500b7669
            Log:
            FIXED JENKINS-29142 (cannot be fixed, but mention workaround)

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: 15knots Path: src/main/resources/hudson/plugins/cmake/CmakeBuilder/help-generator.html http://jenkins-ci.org/commit/cmakebuilder-plugin/bfe1506a258e61d1fa6ed1a8905d7317500b7669 Log: FIXED JENKINS-29142 (cannot be fixed, but mention workaround)
            15knots Martin Weber made changes -
            Field Original Value New Value
            Resolution Not A Defect [ 7 ]
            Status Open [ 1 ] Resolved [ 5 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 164010 ] JNJira + In-Review [ 197383 ]
            15knots Martin Weber made changes -
            Status Resolved [ 5 ] Closed [ 6 ]
            15knots Martin Weber added a comment -

            One possible solution would be to change the plugin to

            run a sub-shell (cmd.exe) which first runs the environment-setter-script (vcvarsall) and then runs cmake.

            There would be an input field in the UI that allows users to specify the path to the environment-setter-script.

            Let me know if this could be a better solution than the workaround.

             

            15knots Martin Weber added a comment - One possible solution would be to change the plugin to run a sub-shell (cmd.exe) which first runs the environment-setter-script (vcvarsall) and then runs cmake. There would be an input field in the UI that allows users to specify the path to the environment-setter-script. Let me know if this could be a better solution than the workaround.  
            15knots Martin Weber made changes -
            Link This issue is duplicated by JENKINS-68992 [ JENKINS-68992 ]
            15knots Martin Weber made changes -
            Link This issue is duplicated by JENKINS-69574 [ JENKINS-69574 ]
            zakalawe James Turner added a comment -

            Apologies for the duplicate report, but I must say I am pretty confused on what the work-around is. Looking at the documentation / HTML change from 2016 doesn't make it any clearer for me.

            Is the approach recommended in Martin Kutny's blog from six years really the best way to solve this? It seems remarkable to me, given Ninja is supposed to be the recommended build tool, even on Windows these days. (Whenever I have an issue with msbuild.exe, I am told to use Ninja....)

             

            zakalawe James Turner added a comment - Apologies for the duplicate report, but I must say I am pretty confused on what the work-around is. Looking at the documentation / HTML change from 2016 doesn't make it any clearer for me. Is the approach recommended in Martin Kutny's blog from six years really the best way to solve this? It seems remarkable to me, given Ninja is supposed to be the recommended build tool, even on Windows these days. (Whenever I have an issue with msbuild.exe, I am told to use Ninja....)  

            People

              Unassigned Unassigned
              simonrichter Simon Richter
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: