Skip to content

fix: export the osqp::osqp target in osqp_vendor_TARGETS - #4

Open
xmfcx wants to merge 1 commit into
moveit:mainfrom
xmfcx:fix/export-osqp-target
Open

xmfcx wants to merge 1 commit into
moveit:mainfrom
xmfcx:fix/export-osqp-target

Conversation

@xmfcx

@xmfcx xmfcx commented Dec 1, 2026 •

Copy link
Copy Markdown

cmake/osqp_vendor-extras.cmake appends the plain name osqp to osqp_vendor_TARGETS. No target with this name exists. The OSQP package exports its library as osqp::osqp, and osqp_vendor already loads it through ament_export_dependencies(osqp).

On Humble and Jazzy, the wrong name does no harm, because ament_target_dependencies() uses only the entries that are targets and falls back to the library paths. On Lyrical (ament_cmake 2.8.8), ament_auto_depend_on_packages() links ${osqp_vendor_TARGETS} directly. A package that depends on osqp_vendor then passes -losqp to the linker without a library path:

/usr/bin/x86_64-linux-gnu-ld.bfd: cannot find -losqp: No such file or directory
collect2: error: ld returned 1 exit status

This PR exports osqp::osqp instead. On Humble and Jazzy, ament_target_dependencies() now takes the target path for osqp_vendor, so consumers also get OSQP_SHARED_LIB and <install>/include/osqp as a system include directory from the target. The link line keeps the full library path.

Tests:

  • Lyrical (Ubuntu 26.04): I built osqp_vendor from this branch, then autoware_osqp_interface against it. The link line holds only <install>/osqp_vendor/lib/libosqp.so, and the 9 tests of that package pass. With the released ros-lyrical-osqp-vendor 1.0.0, the same package fails with the error above.
  • Jazzy (Ubuntu 24.04): the same two packages build, and the 9 tests pass.
  • Not tested: Humble and Rolling.

Found while porting Autoware to Lyrical:

osqp_vendor appended the plain name osqp to osqp_vendor_TARGETS. No target with this name exists, because the OSQP package defines osqp::osqp.

ament_target_dependencies() uses only the entries that are targets, so on Humble and Jazzy the wrong name did no harm. ament_cmake_auto on Lyrical links ${osqp_vendor_TARGETS} directly, so CMake passes -losqp to the linker without a library path, and the link fails with "cannot find -losqp".

Signed-off-by: Mete Fatih Cırıt <mfc@autoware.org>
@coderabbitai

coderabbitai Bot commented Dec 1, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6777db04-0ee1-449f-a954-4475b19765ac
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@xmfcx

xmfcx commented Dec 1, 2026

Copy link
Copy Markdown
Author

@nbbrooks @christianrauch, could you take a look when you have time? It is a one-line fix in cmake/osqp_vendor-extras.cmake. Without it, packages that depend on osqp_vendor 1.0.0 fail to link on Lyrical with cannot find -losqp. The Build workflow has not started on this PR, probably because it needs your approval for a first-time contributor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant