Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some Windows build issues getting details swallowed: #435

Open
rotu opened this issue Apr 17, 2020 · 5 comments
Open

Some Windows build issues getting details swallowed: #435

rotu opened this issue Apr 17, 2020 · 5 comments
Assignees

Comments

@rotu
Copy link
Contributor

rotu commented Apr 17, 2020

Although there are warnings from both cmake and msbuild, the details of the errors are not showing up on their respective warning pages. Just the truncated details "cmd.exe" exited with code 1." for msbuild and nothing for CMake.

https://ci.ros2.org/job/ci_windows/10157/cmake/
https://ci.ros2.org/job/ci_windows/10157/msbuild/

@dirk-thomas
Copy link
Member

@j-rivero Can you please look into this since it is related to the new Jenkins warnings-ng plugin you deployed.

@j-rivero
Copy link
Contributor

I've verified that it happens because the console log displays some blank lines among the cmake warning message:

  CMake Warning (dev) in CMakeLists.txt:

    No project() command is present.  The top-level CMakeLists.txt file must

    contain a literal, direct call to the project() command.  Add a line of

    code such as

  

      project(ProjectName)

  

    near the top of the file, but after cmake_minimum_required().
...

Is this somehow an effect of colcon output? If so, does it happen in colcon log files? If log files does not have this effect, a similar approach to what we have for tests in #316 could help (injecting directly colcon log in the cmake warning plugin configuration. If it is a desired/difficult-to-avoid-effect we could try some workarounds on top of the colcon log file but I would like to avoid it if possible.

@dirk-thomas
Copy link
Member

dirk-thomas commented May 28, 2020

Is this somehow an effect of colcon output?

I doubt it. colcon passes output from invoked commands without modifications.

If so, does it happen in colcon log files?

I don't know - but I would doubt that the content of the log files would be any different than the console output. Have you checked the content of the log file in the case of such a CMake warning?

A test build of an arbitrary package with a CMake warning doesn't show any extra empty lines in the CMake output: https://ci.ros2.org/job/ci_windows/10828/consoleFull#console-section-84

In the builds referenced above the CMake warning happened in an externalproject_add call. A test build using a package which uses that CMake function shows the empty lines: https://ci.ros2.org/job/ci_windows/10829/consoleFull#console-section-33

In this case the console / log contain \r\n line endings.

When rewriting those to only \n within colcon (colcon/colcon-core@c6cc9c9) Jenkins seems to render and process the output correctly: https://ci.ros2.org/job/ci_windows/10834/consoleFull#console-section-33

patch
--- a/colcon_core/task/__init__.py
+++ b/colcon_core/task/__init__.py
@@ -167,6 +167,8 @@ async def run(
     :rtype subprocess.CompletedProcess
     """
     def stdout_callback(line):
+        if line.endswith(b'\r\n'):
+            line = line[:-2] + b'\n'
         context.put_event_into_queue(StdoutLine(line))
 
     def stderr_callback(line):

So I would argue this is a bug in Jenkins or a Jenkins plugin. Not sure if we want to work around it in colcon or fill an issue somewhere for Jenkins.

@j-rivero
Copy link
Contributor

Thanks for looking into it deeper:

So I would argue this is a bug in Jenkins or a Jenkins plugin. Not sure if we want to work around it in colcon or fill an issue somewhere for Jenkins.

Let's try to file a bug in the Jenkins plugin. I'm trying to reproduce it with a minimal use case: https://github.com/j-rivero/cmake_warning_ng_bug. If I use the build.osrfoundation.org buildfarm to run the test case on Windows, the blank lines do not appear (nor the warning, probably different versions of cmake). Same if I built tinydir_vendor direclty, no blank lines in the output. As you mention, If I use colcon there is no difference.

It could be: something that happen with new versions of cmake or my bet is that is something in the configuration of ci.ros2.org buildfarm (maybe another plugin). I can give a look into it if I can create a test job inside ci.ros2.org for this.

@dirk-thomas
Copy link
Member

@j-rivero Any update on this?

@j-rivero j-rivero removed their assignment Nov 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants