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 embedded paths are not relocated on Windows #25

Closed
traversaro opened this issue Oct 8, 2021 · 3 comments · Fixed by #27
Closed

Some embedded paths are not relocated on Windows #25

traversaro opened this issue Oct 8, 2021 · 3 comments · Fixed by #27

Comments

@traversaro
Copy link
Contributor

I am debugging some test failure on ign-sensors6, and they are failing with:

test 21
    Start 21: INTEGRATION_rgbd_camera

21: Test command: C:\src\ign-sensors\build\bin\INTEGRATION_rgbd_camera.exe "--gtest_output=xml:C:/src/ign-sensors/build/test_results/INTEGRATION_rgbd_camera.xml"
21: Test timeout computed to be: 240
21: [==========] Running 1 test from 1 test case.
21: [----------] Global test environment set-up.
21: [----------] 1 test from RgbdCameraSensor/RgbdCameraSensorTest
21: [ RUN      ] RgbdCameraSensor/RgbdCameraSensorTest.ImagesWithBuiltinSDF/ogre
21: [Msg] Loading plugin [ignition-rendering-ogre]
21: [Err] [D:\bld\libignition-rendering6_1633681302936\work\ogre\src\OgreRTShaderSystem.cc:527] Unable to find shader lib. Shader generating will fail.
21: [Err] [D:\bld\libignition-rendering6_1633681302936\work\ogre\src\OgreRTShaderSystem.cc:112] Cannot find OGRE rtshaderlib. Shadows will be disabled.
21: [Dbg] [C:\src\ign-sensors\src\RgbdCameraSensor.cc:222] RGB images for [camera1] advertised on [/test/integration/RgbdCameraPlugin_imagesWithBuiltinSDF/image]
21: [Dbg] [C:\src\ign-sensors\src\RgbdCameraSensor.cc:236] Depth images for [camera1] advertised on [/test/integration/RgbdCameraPlugin_imagesWithBuiltinSDF/depth_image]
21: [Dbg] [C:\src\ign-sensors\src\RgbdCameraSensor.cc:250] Points for [camera1] advertised on [/test/integration/RgbdCameraPlugin_imagesWithBuiltinSDF/points]
21: [Dbg] [C:\src\ign-sensors\src\CameraSensor.cc:524] Camera info for [camera1] advertised on [/test/integration/RgbdCameraPlugin_imagesWithBuiltinSDF/camera_info]
21: [Err] [D:\bld\libignition-rendering6_1633681302936\work\ogre\src\OgreMaterial.cc:433] Vertex shader path does not exist: D:\bld\libignition-rendering6_1633681302936\_h_env\Library\share\ignition\ignition-rendering6\ogre\media\materials\programs\depth_points_vs.glsl
21: [Err] [D:\bld\libignition-rendering6_1633681302936\work\ogre\src\OgreMaterial.cc:482] Fragment shader path does not exist: D:\bld\libignition-rendering6_1633681302936\_h_env\Library\share\ignition\ignition-rendering6\ogre\media\materials\programs\depth_points_fs.glsl
21: unknown file: error: SEH exception with code 0xc0000005 thrown in the test body.
21: [  FAILED  ] RgbdCameraSensor/RgbdCameraSensorTest.ImagesWithBuiltinSDF/ogre, where GetParam() = "ogre" (408 ms)
21: [----------] 1 test from RgbdCameraSensor/RgbdCameraSensorTest (408 ms total)
21:
21: [----------] Global test environment tear-down
21: [==========] 1 test from 1 test case ran. (408 ms total)
21: [  PASSED  ] 0 tests.
21: [  FAILED  ] 1 test, listed below:
21: [  FAILED  ] RgbdCameraSensor/RgbdCameraSensorTest.ImagesWithBuiltinSDF/ogre, where GetParam() = "ogre"
21:
21:  1 FAILED TEST
1/2 Test #21: INTEGRATION_rgbd_camera ..........***Failed    0.67 sec
@traversaro
Copy link
Contributor Author

traversaro commented Oct 8, 2021

In particular the path D:\bld\libignition-rendering6_1633681302936\_h_env\Library\share\ignition\ignition-rendering6\ogre\media\materials\programs should not be there and should be instead the installed one, so something in C: .

@traversaro
Copy link
Contributor Author

Apparently a workaround is to set (see https://github.com/ignitionrobotics/ign-rendering/blob/fe9b5b3e1614f4f7ff3fb275a361d6de26d0fc6b/ogre/src/OgreRenderEngine.cc#L566):

set IGN_RENDERING_PLUGIN_PATH=%CONDA_PREFIX%\Library\lib\ign-rendering-6\engine-plugins\
set OGRE_RESOURCE_PATH=%CONDA_PREFIX%\Library\bin
set IGN_RENDERING_RESOURCE_PATH=%CONDA_PREFIX%\Library\share\ignition\ignition-rendering6

By setting this env variables, the test is finally able to pass:

test 21
    Start 21: INTEGRATION_rgbd_camera

21: Test command: C:\src\ign-sensors\build\bin\INTEGRATION_rgbd_camera.exe "--gtest_output=xml:C:/src/ign-sensors/build/test_results/INTEGRATION_rgbd_camera.xml"
21: Test timeout computed to be: 240
21: [==========] Running 1 test from 1 test case.
21: [----------] Global test environment set-up.
21: [----------] 1 test from RgbdCameraSensor/RgbdCameraSensorTest
21: [ RUN      ] RgbdCameraSensor/RgbdCameraSensorTest.ImagesWithBuiltinSDF/ogre
21: [Msg] Loading plugin [ignition-rendering-ogre]
21: [Dbg] [C:\src\ign-sensors\src\RgbdCameraSensor.cc:222] RGB images for [camera1] advertised on [/test/integration/RgbdCameraPlugin_imagesWithBuiltinSDF/image]
21: [Dbg] [C:\src\ign-sensors\src\RgbdCameraSensor.cc:236] Depth images for [camera1] advertised on [/test/integration/RgbdCameraPlugin_imagesWithBuiltinSDF/depth_image]
21: [Dbg] [C:\src\ign-sensors\src\RgbdCameraSensor.cc:250] Points for [camera1] advertised on [/test/integration/RgbdCameraPlugin_imagesWithBuiltinSDF/points]
21: [Dbg] [C:\src\ign-sensors\src\CameraSensor.cc:524] Camera info for [camera1] advertised on [/test/integration/RgbdCameraPlugin_imagesWithBuiltinSDF/camera_info]
21: [       OK ] RgbdCameraSensor/RgbdCameraSensorTest.ImagesWithBuiltinSDF/ogre (891 ms)
21: [----------] 1 test from RgbdCameraSensor/RgbdCameraSensorTest (891 ms total)
21:
21: [----------] Global test environment tear-down
21: [==========] 1 test from 1 test case ran. (891 ms total)
21: [  PASSED  ] 1 test.
1/2 Test #21: INTEGRATION_rgbd_camera ..........   Passed    1.15 sec

While we could just set these in the activation scripts, we would lose the feature of being able to install side by side different major version of ignition-rendering. Probably we should just check the point in which the paths are used, and add a workaround like the one in conda-forge/libignition-common-feedstock#36 where needed.

@traversaro
Copy link
Contributor Author

traversaro commented Oct 9, 2021

As some of the problems seems to affect at least also macOS (see conda-forge/libignition-sensors-feedstock#17 (comment)), I think that perhaps just setting the env variables in the activation scripts is the least worst solution. Tryng to fix the binary relocation by reading conda/conda-build#1674 and conda/conda-build#2524 seems to be quite black magic (at least from what I understand of it right now) and that seems time that would be better spent by making properly relocatable (something like https://www.qt.io/blog/qt-is-relocatable) ignition-rendering upstream, that would benefit also other package managers that do not have "magic" binary relocation like conda (there was already some interest in this direction from people packaging ign-gazebo in conan, see gazebosim/gz-sim#626 for example).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant