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

Add optional binary relocatability #218

Merged
merged 1 commit into from
Apr 3, 2024

Conversation

traversaro
Copy link
Contributor

🎉 New feature

Closes part of gazebosim/gz-sim#626

Summary

This PR uses the changes introduced in gz-cmake3 in gazebosim/gz-cmake#334 to support the cmake installation directory to be moved after the make install prefix, and continue to work without the need to set any special environment variable, as long as the library is compiled as shared. To avoid regressions and problems in Ubuntu Focal due to the use of std::filesystem, this new behaviour is only activated if the GZ_ENABLE_RELOCATABLE_INSTALL option is enabled, and its default value is OFF .

In particular, this PR defines the functions gz::launch::getPluginInstallPath() and gz::launch::getInitialConfigPath() that should be used in place of the GZ_LAUNCH_PLUGIN_INSTALL_PATH and GZ_LAUNCH_INITIAL_CONFIG_PATH macros to ensure that the library is relocatable.

Furthermore, this PR also deprecates the GZ_LAUNCH_PLUGIN_INSTALL_PATH and GZ_LAUNCH_INITIAL_CONFIG_PATH macros, using the strategy described in https://stackoverflow.com/a/29297970 . That strategy works fine on GCC and Clang, while on MSVC it raise a warning:

warning C4068: unknown pragma

However, I think that it does anyhow the job of raising some kind of warning, and then at soon as the developer checks the macro definition the kind of warning is clear.

Test it

The test should work as usual. The used CMake machinery is tested in gazebosim/gz-cmake#334 .

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

Signed-off-by: Silvio Traversaro <[email protected]>
@codecov
Copy link

codecov bot commented May 8, 2023

Codecov Report

Merging #218 (237c9e8) into gz-launch6 (7a81015) will decrease coverage by 0.69%.
The diff coverage is 0.00%.

❗ Current head 237c9e8 differs from pull request most recent head 5379713. Consider uploading reports for the commit 5379713 to get more accurate results

@@              Coverage Diff               @@
##           gz-launch6     #218      +/-   ##
==============================================
- Coverage       56.90%   56.22%   -0.69%     
==============================================
  Files               3        4       +1     
  Lines             413      418       +5     
==============================================
  Hits              235      235              
- Misses            178      183       +5     
Impacted Files Coverage Δ
src/InstallationDirectories.cc 0.00% <0.00%> (ø)
src/Manager.cc 53.73% <0.00%> (ø)
src/cmd/gz.cc 72.72% <0.00%> (-7.28%) ⬇️

@azeey azeey added the beta Targeting beta release of upcoming collection label Jul 31, 2023
@mjcarroll mjcarroll removed the beta Targeting beta release of upcoming collection label Aug 31, 2023
@traversaro
Copy link
Contributor Author

traversaro commented Feb 21, 2024

@mjcarroll I was reviewing a bit the state of gazebosim/gz-sim#626, I noticed this PR, there is anything I need to do on my side? If it simplifies I can rebase it or just retarget it to gz-launch7 .

@azeey azeey requested a review from mjcarroll March 18, 2024 18:48
@mjcarroll mjcarroll merged commit 17835ca into gazebosim:gz-launch6 Apr 3, 2024
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌱 garden Ignition Garden
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants