Skip to content

fix(pkg): install the ob-standalone-setup links under the install-time prefix - #273

Merged
guimard merged 1 commit into
mainfrom
fix/cpack-standalone-symlink
Sep 10, 2026
Merged

guimard merged 1 commit into
mainfrom
fix/cpack-standalone-symlink

Conversation

@guimard

@guimard guimard commented Sep 10, 2026

Copy link
Copy Markdown
Member

Reported by @orontee on #272: the "Build Debian Package" job logs two CMake Errors and still passes.

CMake Error: failed to create symbolic link '…/_CPack_Packages/Linux/DEB/open-bastion-0.6.2-Linux/usr/local/sbin/ob-standalone-setup': No such file or directory
CMake Error: failed to create symbolic link '…/usr/local/share/man/man8/ob-standalone-setup.8': No such file or directory

It is not specific to #272 — main has the same two lines.

Cause

The two links were made by install(CODE) against CMAKE_INSTALL_FULL_SBINDIR / CMAKE_INSTALL_FULL_MANDIR. Those are baked at configure time (/usr/local/...), but cpack installs under /usr. The parent directory does not exist in the staging tree, create_symlink fails, execute_process ignores the result, and cpack exits 0 — with a .deb that has no ob-standalone-setup and no ob-standalone-setup.8.

dpkg-buildpackage (dh, prefix /usr) and rpmbuild (%cmake) configure with /usr, so the paths matched there: the released packages were not affected (and both list the link explicitly, so their builds would fail without it).

Fix

  • The links are made in the build tree at configure time and installed with install(FILES … DESTINATION ${CMAKE_INSTALL_SBINDIR}) (resp. ${CMAKE_INSTALL_MANDIR}/man8). A relative destination follows the install-time prefix and DESTDIR. Works with our cmake_minimum_required(3.10).
  • The CI package job now fails when cpack reports a CMake Error, since cpack itself does not.

Verified locally

$ cpack -G DEB    # before: 2 × CMake Error, link absent from the .deb
$ cpack -G DEB    # after: 0 × CMake Error
$ dpkg-deb -c open-bastion-0.6.2-Linux.deb | grep standalone
lrwxrwxrwx root/root 0 … ./usr/sbin/ob-standalone-setup -> ob-bastion-setup
lrwxrwxrwx root/root 0 … ./usr/share/man/man8/ob-standalone-setup.8 -> ob-bastion-setup.8

and cmake -DCMAKE_INSTALL_PREFIX=/usr + DESTDIR=… cmake --install (the dh/rpm path) installs both as symlinks.

https://claude.ai/code/session_01Bh9aBGroMwsqpv4q5foHT3

…e prefix

The two links were made by install(CODE) against CMAKE_INSTALL_FULL_SBINDIR
and CMAKE_INSTALL_FULL_MANDIR, which are baked at configure time
(/usr/local/...). cpack installs under /usr, so the parent directory did not
exist in its staging tree, create_symlink failed with ENOENT, execute_process
ignored it, and cpack still exited 0: the CI .deb shipped without
ob-standalone-setup and its man page.

dpkg-buildpackage and rpmbuild configure with prefix /usr, so the paths
matched there and the released packages were not affected.

The links are now made in the build tree and installed with install(FILES)
and a relative DESTINATION, which follows the install-time prefix and
DESTDIR. The CI package job fails when cpack reports a CMake Error, since
cpack itself does not.

Claude-Session: https://claude.ai/code/session_01Bh9aBGroMwsqpv4q5foHT3
@guimard
guimard merged commit 837518e into main Sep 10, 2026
16 checks passed
@guimard
guimard deleted the fix/cpack-standalone-symlink branch September 15, 2026 04:56
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