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

Resolving filenames doesn't work with cmake/ninja generator

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • analysis-model
    • None
    • warnings-ng 4.0.0, analysis-model-api 3.0.0

      I've a c++ project which is created with cmake (CMake build).

      When cmake create normal Makefiles, the warnings can be parsed and the warnings page contains the affected source files including a link to the source file:

      When I use 'Ninja' as 'Script Generator', the warnings page also shows all warnings but the source files are without a link:

      I did not change anything other so I assume the output is a little bit different so the warnings parser can not parse it.

      In the log file I see a warning: 'Can't resolve absolute path for some files' which would explain the problem. Looks like Ninja outputs relative paths. I'm using a build subdirectoy ('Build Directory').

        1. log.makefile
          4 kB
        2. log.ninja
          5 kB
        3. with_link.jpg
          with_link.jpg
          9 kB
        4. without_link.jpg
          without_link.jpg
          9 kB

          [JENKINS-56020] Resolving filenames doesn't work with cmake/ninja generator

          Ulli Hafner added a comment -

          The make output is used to create absolute file names. Is there something similar in Ninja?

          make[1]: Entering directory `/dir1/dir2'
          

          Ulli Hafner added a comment - The make output is used to create absolute file names. Is there something similar in Ninja? make[1]: Entering directory `/dir1/dir2'

          Christian Ehrlicher added a comment - - edited

          Not from ninja but from cmake:

          '-- Build files have been written to: /path/to/build/dir'

          It's in the log so the warnings plugin should have access to it.

          Christian Ehrlicher added a comment - - edited Not from ninja but from cmake: '-- Build files have been written to: /path/to/build/dir' It's in the log so the warnings plugin should have access to it.

          Ulli Hafner added a comment -

          Hmm, the text is have been written , is such a message before or after a warning?

          Maybe it would be easier if you would attach a snippet of the console log that contains some of the messages above and some warnings? Then I can create a simple unit tests from the log.

          Ulli Hafner added a comment - Hmm, the text is have been written , is such a message before or after a warning? Maybe it would be easier if you would attach a snippet of the console log that contains some of the messages above and some warnings? Then I can create a simple unit tests from the log.

          This output comes from cmake which is executed before the compilation. I'll try to create a simple test log.

          Christian Ehrlicher added a comment - This output comes from cmake which is executed before the compilation. I'll try to create a simple test log.

          I've attached two logs from a test project - one with makefile generator and one with ninja

          Christian Ehrlicher added a comment - I've attached two logs from a test project - one with makefile generator and one with ninja

            drulli Ulli Hafner
            chehrlic Christian Ehrlicher
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: