Respect DESTDIR for suffix-2 library symlinks - #5
Open
jasonhaak wants to merge 3 commits into
Open
Conversation
There was a problem hiding this comment.
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}/libdirectory usingcmake -E make_directory. - Create
libbrscandec2.soandlibbrcolm2.sosymlinks under$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/libto respect staged installs.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A symlink problem surfaced while staging the Raspberry Pi build for installation as a package with brscan2.
Staged installations use
DESTDIRto 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/libpath and failed with a permission error.After adding
DESTDIRto the symlink destinations, the installation reached a second issue: the stagedusr/libdirectory had not yet been created when the custom install code ran. The symlink creation therefore failed withNo such file or directory.This change creates the staged library directory first, then creates:
inside the staged installation root.
Validation
Tested on a Raspberry Pi running Debian 13 on ARM64.