0
$\begingroup$

Rosanswers logo

Hi, Is it correct that ROS2 on windows fails to build many of its default packages? I precisely followed these steps to set up my environment for ROS2 bouncy and everything went fine. I installed opensplice, but had the same issues when trying to compile before I installed it. I checked my PATH as well. When I run

colcon build --merge-install

every now and then, it fails to compile a package, which "exited with code 1". I then put an AMENT_IGNORE in the respecting folder and try again, just to see if it somehow can compile. But shouldn't these packages compile without failure?

To be precise, these packages fail to build: pluginlib, rviz, osrf, rcutils, demos, rmw, rcl_interfaces, std_srvs, std_msgs. I also ignored the following: examples, examples_interfaces, rmw_connext, rmw_typesupport_connext.

Also, when I

cd \dev\ros2
call C:\opensplice67\HDE\x86_64.win64\release.bat
call install\local_setup.bat
ros2

the setup runs fine with no output, but I get "command not found" on ros2. Just as in this question.

Can anyone give me at least a hint? I would really appreciate it. Thank you in advance!

EDIT:

Program versions I use:

  • Visual Studio: Community 2017 (15.8.1)
  • OpenSplice: 6.7
  • colcon: latest version as of now (I don't know how to find the version number)
  • Python: 3.7
  • Qt5: 5.10.0 (but I have also installed: 5.10.1, 5.11.0, 5.11.1)

It seems that when building packages fail to compile because they depend on each other but prevent their dependencies from being built while failing themselves. So when compiling step-by-step while adding one package each step (and unfortunately in the right but unknown order), as of now, at least some of the packages listed above compile.

While other packages compile because they only had missing dependencies, osrf_testing_tools_cpp gives me:

C:\dev\ros2>colcon build --packages-select osrf_testing_tools_cpp --merge-install --event-handler console_cohesion+
Starting >>> osrf_testing_tools_cpp
[4.039s] colcon.colcon_core.event_reactor ERROR Exception in event handler extension 'console_cohesion': 'charmap' codec can't decode byte 0x81 in position 2981: character maps to <undefined>
Traceback (most recent call last):
  File "c:\python37\lib\site-packages\colcon_core\event_reactor.py", line 78, in _notify_observers
retval = observer(event)
  File "c:\python37\lib\site-packages\colcon_output\event_handler\console_cohesion.py", line 49, in __call__
content = h.read()
  File "c:\python37\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 2981: character maps to <undefined>

Failed   <<< osrf_testing_tools_cpp     [ Exited with code 1 ]

Summary: 0 packages finished [3.67s]
  1 package failed: osrf_testing_tools_cpp

After downgrading to Visual Studio Community 2017 (15.7.6), not only osrf_testing_tools_cpp, but all packages not directly related to connext compile fine. Also, the build finishes and is not aborted (as was before). (See accepted answer)


Originally posted by Marcel Usai on ROS Answers with karma: 200 on 2018-08-30

Post score: 1


Original comments

Comment by gvdhoorn on 2018-08-30:
Bouncy is supposed to compile 'cleanly' on Win10, but things can of course change. Windows 10 is a bit of a 'moving target', so if any of the dependencies change versions then some things could break.

It might help if you could list the versions of some important components: VS, OpenSplice, ..

Comment by gvdhoorn on 2018-08-30:
.., colcon, Python and Qt5.

But above all:

Is it correct that ROS2 on windows fails to build

this is too vague. Without actual error messages (copy-pasted) we will only ever be able to guess at what might be wrong.

Please add more information to your question.

Comment by Marcel Usai on 2018-08-30:
colcon does not give me error messages! I am currently working my way through this. As of now, osrf_testing_tools_cpp fails to build with colcon but shows no reason. I will add my version numbers but they are exactly as in the tutorial...

Comment by gvdhoorn on 2018-08-30:
can you try building one of the failing packages with the following option added to the command line:

--event-handler console_cohesion+

That should provide you with a bit more information.

Comment by gvdhoorn on 2018-08-30:
That is why I asked the OP to report exact versions. Visual Studio is one such moving target I referred to earlier. It almost makes you wonder whether they don't have enough test coverage at MS when checking their VS releases.

Comment by gvdhoorn on 2018-08-30:
re: your latest edit: this could have nothing to do with it, but are you running a Windows 10 with a German locale configured?

Comment by Marcel Usai on 2018-08-30:
@gvdhoorn: yes

Comment by gvdhoorn on 2018-08-30:
If downgrading VS doesn't work (and I have a bit of a feeling it won't, but let's see), could you add a English (US) locale and switch to that. Then see if something changes? Be sure to (at least) log-out and then back in.

You should be able to revert back to German without issue afterwards.

Comment by gvdhoorn on 2018-08-30:
I'm not sure, but I believe the error colcon shows is not the real error, but the console_cohesion callback not being able to display the actual error due to a codec/locale issue.

Comment by gvdhoorn on 2018-08-30:\

After downgrading to Visual Studio Community 2017 (15.7.6), osrf_testing_tools_cpp compiles fine.

glad things compile.

I'm wondering though if you won't run into the same problem again if any other pkg has trouble compiling.

Comment by Marcel Usai on 2018-08-30:
Thanks, with VS 15.7.6, at least osrf_testing_tools_cpp compiles fine. I somehow missed that I installed the wrong VS version. Will test now if that solved everything. Also, I updated my question.

Comment by Marcel Usai on 2018-08-30:
The locale thing seems odd to me. But yes, my output is from the console_cohesion failing to display the error. In the log files I had a long list of weird stuff... I will report, if I got stuck again.

Comment by Dirk Thomas on 2018-08-30:
colcon version-check will tell you the versions of all colcon related packages as well as if they are up-to-date.

Comment by gvdhoorn on 2018-08-30:\

The locale thing seems odd to me. But yes, my output is from the console_cohesion failing to display the error

then I expect future compilation/linker errors to result in the same problem, but let's see whether you post a new question.

Comment by Dirk Thomas on 2018-08-30:
I am surprised that in the case of osrf_testing_tools_cpp failing to build there is no stderr output. Can you provide the content of the log/build_<timestamp> directory when you built just osrf_testing_tools_cpp and it failed without any output. That might help identifying a problem.

Comment by Dirk Thomas on 2018-08-30:
Please consider trying https://github.com/colcon/colcon-output/pull/13 which aims to address the exception you experienced when using --event-handler console_cohesion+.

Comment by Marcel Usai on 2018-08-31:
@Dirk Thomas I can provide my log files from when it failed.

Comment by Marcel Usai on 2018-08-31:
Also, my build finishes now. Only a few connext related packages report a stderr output. I guess, I can ignore those as I do not want to use connext?

Comment by Dirk Thomas on 2018-08-31:
Thank you for sharing the logs. I am pretty confident that the PR will fix this case: https://github.com/colcon/colcon-output/pull/13#issuecomment-417714567

Comment by Dirk Thomas on 2018-08-31:
Yes, you can ignore the warnings about Connext if you don't want to use it.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

There are also reports of the latest version of Visual Studio 2017 (15.8) having some new compiler errors. There is an issue here: https://github.com/osrf/osrf_testing_tools_cpp/issues/15

I can confirm that Bouncy compiles on Windows 10 with Visual Studio 2017 (15.0), try downgrading if possible.


Originally posted by mjcarroll with karma: 6414 on 2018-08-30

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by Marcel Usai on 2018-08-30:
@gvdhoorn: I updated my question. @mjcarroll: I run version 15.8.1, will downgrade to 15.0 and try again.

Thank you for your time!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.