fix(packaging): Individual SightCalibrator package doesn't work on Linux
Description
On Linux, the individual SightCalibrator package doesn't work on Linux, crashing on startup with the following error:
terminate called after throwing an instance of 'sight::core::runtime::RuntimeException'
what(): Error while adding modules. '/home/lschmidt/Téléchargements/share/sight': not a directory.
The SightCalibrator included in the SDK works correctly, however. The individual SightViewer package works correctly as well. The error doesn't appear on Windows either.
Steps to reproduce
Download the latest package from dev, uncompress it, and then launch SightCalibrator. The application will immediately crash with the error above.
Proposal
It seems SightCalibrator tries to search the modules in one folder too up. For example, in the error message above, it tries to search for the modules in '/home/lschmidt/Téléchargements/share/sight', while the expected folder would be '/home/lschmidt/Téléchargements/SightCalibrator/share/sight'. It is unknown why it does work in the SDK version, though.
Functional specifications
No change.
Technical specifications
We rely on detecting the keyword "lib" or "bin" in the path. Guess why SightViewer
launches and SightCalibrator
doesn't? No really? Read twice.
This is also why it works with the SDK, it unpacks in sight*
while the SightCalibrator
version unpacks into SightCalibrator*
.
I propose to:
- delimit the keyword by slashes to avoid false positives.
- perform the lookup in reverse order, in case we have any other "/lib/" occurrence in the path.
Test plan
- Any application should launch from the build folder.
- Any application installed from a package should launch.