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

Callind find_package(rerun_sdk) twice results in CMake error #5885

Closed
traversaro opened this issue Apr 9, 2024 · 0 comments · Fixed by #5886
Closed

Callind find_package(rerun_sdk) twice results in CMake error #5885

traversaro opened this issue Apr 9, 2024 · 0 comments · Fixed by #5886
Labels
🪳 bug Something isn't working 🌊 C++ API C/C++ API specific

Comments

@traversaro
Copy link
Contributor

Describe the bug

When rerun_sdk is installed as a CMake package, calling find_package(rerun_sdk) two times fails with error:

2024-04-09T17:03:46.1160429Z CMake Error at /home/conda/feedstock_root/build_artifacts/librerun-sdk_1712681417062/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/lib/cmake/rerun_sdk/rerun_sdkConfig.cmake:56 (add_library):
2024-04-09T17:03:46.1161073Z   add_library cannot create ALIAS target "rerun_arrow_target" because another
2024-04-09T17:03:46.1161313Z   target with the same name already exists.

or a similar error depending on which options are enabled in the rerun_sdk compilation. The problem is that imported CMake targets are defined in rerun_sdkConfig.cmake without checking if they are already defined.

In general it is important for a CMake project to be safely found two times via find_package, as if rerun_sdk is used as a public dependency in two libraries, let's call them libA and libB, then find_package(libA) followed by find_package(libB) results in two transitive find_package(rerun_sdk) calls.

To Reproduce
Steps to reproduce the behavior:

Expected behavior

Screenshots

Backtrace

Desktop (please complete the following information):

  • OS:

Rerun version

0.15.0

Additional context

Problem detected in conda-forge/librerun-sdk-feedstock#5 (comment) .

@traversaro traversaro added 👀 needs triage This issue needs to be triaged by the Rerun team 🪳 bug Something isn't working labels Apr 9, 2024
@emilk emilk added 🌊 C++ API C/C++ API specific and removed 👀 needs triage This issue needs to be triaged by the Rerun team labels Apr 10, 2024
emilk pushed a commit that referenced this issue Apr 10, 2024
Fix #5885 .


### What

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested the web demo (if applicable):
* Using newly built examples:
[rerun.io/viewer](https://rerun.io/viewer/pr/5886)
* Using examples from latest `main` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/5886?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/5886?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG
* [x] If applicable, add a new check to the [release
checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)!

- [PR Build Summary](https://build.rerun.io/pr/5886)
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)
emilk pushed a commit that referenced this issue Apr 10, 2024
Fix #5885 .


### What

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested the web demo (if applicable):
* Using newly built examples:
[rerun.io/viewer](https://rerun.io/viewer/pr/5886)
* Using examples from latest `main` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/5886?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/5886?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG
* [x] If applicable, add a new check to the [release
checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)!

- [PR Build Summary](https://build.rerun.io/pr/5886)
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)
@Wumpf Wumpf modified the milestone: 0.15.1 Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪳 bug Something isn't working 🌊 C++ API C/C++ API specific
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants