Skip to content

Respect DESTDIR for suffix-2 library symlinks - #5

Open
jasonhaak wants to merge 3 commits into
dmikushin:masterfrom
jasonhaak:fix/staged-install-suffix2-symlinks
Open

Respect DESTDIR for suffix-2 library symlinks#5
jasonhaak wants to merge 3 commits into
dmikushin:masterfrom
jasonhaak:fix/staged-install-suffix2-symlinks

Conversation

@jasonhaak

Copy link
Copy Markdown

Summary

A symlink problem surfaced while staging the Raspberry Pi build for installation as a package with brscan2.

Staged installations use DESTDIR to place files in a temporary package root instead of writing to the live system.

The suffix-2 compatibility symlinks did not follow that rule. They were created directly under ${CMAKE_INSTALL_PREFIX}/lib, so staging attempted to write to the live /usr/lib path and failed with a permission error.

After adding DESTDIR to the symlink destinations, the installation reached a second issue: the staged usr/lib directory had not yet been created when the custom install code ran. The symlink creation therefore failed with No such file or directory.

This change creates the staged library directory first, then creates:

libbrscandec2.so -> libbrscandec.so
libbrcolm2.so    -> libbrcolm.so

inside the staged installation root.

Validation

Tested on a Raspberry Pi running Debian 13 on ARM64.

  • The project configured and built successfully.
  • A staged installation completed without CMake errors.
  • The staged compatibility symlinks were created with the expected targets.

Copilot AI review requested due to automatic review settings August 2, 2026 11:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes staged (DESTDIR) installs by ensuring the “suffix-2” compatibility symlinks are created under the staging root rather than writing directly to the live install prefix. It also creates the target ${prefix}/lib directory within the staged root before attempting symlink creation, preventing failures when the directory doesn’t yet exist.

Changes:

  • Pre-create the staged ${CMAKE_INSTALL_PREFIX}/lib directory using cmake -E make_directory.
  • Create libbrscandec2.so and libbrcolm2.so symlinks under $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib to respect staged installs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants