When compiling with /MP, Visual Studio extends warnings with a note

          (compiling source file F:\ull\path.cpp)

      which is parsed as part of the directory, so warnings are shown with a directory name that looks like

         ] (compiling source file F:\ull\path.cpp)F:\ull\path\to\directory

      This also breaks collapsing identical warnings in headers.

        1. dir.png
          60 kB
          Simon Richter

          [JENKINS-56450] MSBuild parser fails when compiling with /MP

          Simon Richter created issue -

          Ulli Hafner added a comment -

          Is there a reason to use /MP?

          Can you please add a text based sample of some of those messages?

          Ulli Hafner added a comment - Is there a reason to use /MP ? Can you please add a text based sample of some of those messages?
          Ulli Hafner made changes -
          Epic Link New: JENKINS-56456 [ 198054 ]
          Ulli Hafner made changes -
          Assignee Original: Ulli Hafner [ drulli ]
          Labels New: help-wanted newbie-friendly

          Simon Richter added a comment - - edited

          Typical lines look like

          C:\Jenkins\workspace\windows-kicad-msvc-tom\build\release\cpu\amd64\label\msvc\src\include\footprint_info.h(320): warning C4251: 'FOOTPRINT_ASYNC_LOADER::m_last_table': class 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>' needs to have dll-interface to be used by clients of class 'FOOTPRINT_ASYNC_LOADER' (compiling source file C:\Jenkins\workspace\windows-kicad-msvc-tom\build\release\cpu\amd64\label\msvc\src\cvpcb\cvpcb_mainframe.cpp) [C:\Jenkins\workspace\windows-kicad-msvc-tom\build\release\cpu\amd64\label\msvc\build\cvpcb\cvpcb_kiface.vcxproj]
            C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include\xstring(4373): note: see declaration of 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>' (compiling source file C:\Jenkins\workspace\windows-kicad-msvc-tom\build\release\cpu\amd64\label\msvc\src\cvpcb\cvpcb_mainframe.cpp)

          The project uses /MP because we have rather few output binaries that depend on each other, and comparatively many source files. With MSBuild's /M option, we get a maximum concurrency of 1–3, while /MP uses all 32 CPUs on our build server for about 90% of the time, reducing build time from 40 to 5 minutes.

          Simon Richter added a comment - - edited Typical lines look like C:\Jenkins\workspace\windows-kicad-msvc-tom\build\release\cpu\amd64\label\msvc\src\include\footprint_info.h(320): warning C4251: 'FOOTPRINT_ASYNC_LOADER::m_last_table': class 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>' needs to have dll-interface to be used by clients of class 'FOOTPRINT_ASYNC_LOADER' (compiling source file C:\Jenkins\workspace\windows-kicad-msvc-tom\build\release\cpu\amd64\label\msvc\src\cvpcb\cvpcb_mainframe.cpp) [C:\Jenkins\workspace\windows-kicad-msvc-tom\build\release\cpu\amd64\label\msvc\build\cvpcb\cvpcb_kiface.vcxproj]   C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include\xstring(4373): note: see declaration of 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>' (compiling source file C:\Jenkins\workspace\windows-kicad-msvc-tom\build\release\cpu\amd64\label\msvc\src\cvpcb\cvpcb_mainframe.cpp) The project uses /MP because we have rather few output binaries that depend on each other, and comparatively many source files. With MSBuild's /M option, we get a maximum concurrency of 1–3, while /MP uses all 32 CPUs on our build server for about 90% of the time, reducing build time from 40 to 5 minutes.

          Ulli Hafner added a comment -

          Can you please wrap in {noformat} before and after the log?

          Ulli Hafner added a comment - Can you please wrap in {noformat} before and after the log?

          Simon Richter added a comment -

          Done.

          Simon Richter added a comment - Done.

          Ulli Hafner added a comment -

          I don't want to be pedantic but a parsers reads the log Are the whitespace at the beginning of the 2nd line correct? (I can't change the comment on my own).

          Ulli Hafner added a comment - I don't want to be pedantic but a parsers reads the log Are the whitespace at the beginning of the 2nd line correct? (I can't change the comment on my own).

          Simon Richter added a comment -

          Yes, these are correct. For C++ templates, this is quite common, these are in principle an extension of the previous message. In theory they can be interleaved with messages from other source files (with cl.exe /MP) and/or projects (with MSBuild /M), the latter is equivalent to the [0-9]+> prefixes generated by VS 2015 and earlier (and some versions of 2017 IIRC). I have never seen the interleaving in effect though, only read about it in bug reports, as this seems to be timing dependent.

          Simon Richter added a comment - Yes, these are correct. For C++ templates, this is quite common, these are in principle an extension of the previous message. In theory they can be interleaved with messages from other source files (with cl.exe /MP) and/or projects (with MSBuild /M), the latter is equivalent to the [0-9] +> prefixes generated by VS 2015 and earlier (and some versions of 2017 IIRC). I have never seen the interleaving in effect though, only read about it in bug reports, as this seems to be timing dependent.

          Ulli Hafner added a comment -

          Ok. So one warning is expected (the note at line 2 is ignored because it starts not at position 1).

          Ulli Hafner added a comment - Ok. So one warning is expected (the note at line 2 is ignored because it starts not at position 1).

            laebi Lorenz Aebi
            simonrichter Simon Richter
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: