conda-forge / gz-sim-feedstock

A conda-smithy repository for gz-sim.
BSD 3-Clause "New" or "Revised" License
0 stars 3 forks source link

gz-sim -g fails on Windows when the current working directory is in a different partition w.r.t. the %CONDA_PREFIX% #57

Open traversaro opened 4 months ago

traversaro commented 4 months ago

Solution to issue cannot be found in the documentation.

Issue

gz sim -g fails on Windows with error:

(gzsimyes) C:\Users\straversaro>gz sim -g
DynamicFactory(): Unable to parse descriptor set from [D:\miniforge3\envs\gzsimyes\Library\share\gz\protos\gz-msgs10.gz_desc]
[GUI] [Err] [D:\bld\gz-rendering8_1713962223982\work\ogre2\src\Ogre2RenderEngine.cc:800] unable to find OpenGL 3+ Rendering Subsystem. OGRE is probably installed incorrectly. Double check the OGRE cmake output, and make sure OpenGL is enabled.
D:/miniforge3/envs/gzsimyes/Library/lib/ruby/gz/cmdsim8.rb:510: [BUG] Segmentation fault
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x64-mswin64_140]

Interestingly, as soon as glew 2.1.0 is installed, everything works fine. I guess if there is some hidden dependencies on glew.

Installed packages

.

Environment info

.
traversaro commented 4 months ago

No, the glew think was just a big spurious correlation. The actual reason for the error is if you start gz sim in a working directory in a partition different from the one in which gz-rendering is installed.

traversaro commented 4 months ago

This was interesting. The message actually signals that something is wrong with OGRE2_RESOURCE_PATH, as reported in https://github.com/gazebosim/gz-rendering/issues/596 .

The problem is in https://github.com/gazebosim/gz-rendering/blob/9f397e12fb013a4ce94f629d1a65df0bbe41f675/ogre2/src/Ogre2RenderEngine.cc#L163, where the OGRE2_RESOURCE_PATH is splitted using : as a separator, while on Windows ; should be used. So C:/this/is/the/ogre2/resource/path gets actually converted to C (that is not a valid path) and /this/is/the/ogre2/resource/path, that indeed is a valid path, as long as the currently active partition is C:, while it stops being a valid path once the active partition is something else.