packaging: split vgpu perception into separate libvgpu-perception0 + -dev packages

- the vmsig package no longer ships the gpu lib; it is a Sensor lib for the control, not the daemon
- vgpu-perception gets SOVERSION; runtime (libvgpu-perception0) and dev (-dev) packages, like the vmie split
- per-component install + a 3-package make deb; fix a stale comment (the windows producer is in-tree)
This commit is contained in:
2026-06-22 20:32:21 +03:00
parent d1aa09ecac
commit 0289817821
9 changed files with 109 additions and 56 deletions
+28 -21
View File
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.16) cmake_minimum_required(VERSION 3.16)
project(vmsig VERSION 0.3.3 LANGUAGES C) project(vmsig VERSION 0.3.4 LANGUAGES C)
set(CMAKE_C_STANDARD 17) set(CMAKE_C_STANDARD 17)
set(CMAKE_C_STANDARD_REQUIRED ON) set(CMAKE_C_STANDARD_REQUIRED ON)
@@ -117,16 +117,18 @@ add_executable(vmsig_cli src/cli.c)
target_link_libraries(vmsig_cli PRIVATE vmsig) target_link_libraries(vmsig_cli PRIVATE vmsig)
target_compile_options(vmsig_cli PRIVATE -Wall -Wextra) target_compile_options(vmsig_cli PRIVATE -Wall -Wextra)
# ---- vgpu-perception: host-side vgpu Sensor S-lib (absorbed in-tree) --------- # ---- vgpu-perception: host-side vgpu Sensor S-lib ---------------------------
# A SEPARATE shipped library (NOT fused into libvmsig — it is consumed by the shell, not the # Packaged SEPARATELY from the daemon (libvgpu-perception0 + -dev), NOT fused into libvmsig —
# signaling core). Host-only: reads the vgpu shared region from its own RO vmie_mem. Built # a Sensor lib consumed by a control/shell, not the signaling core. Host-only: reads the vgpu
# only when armed (needs vmie). The in-guest Windows producer (vgpu-streamer.exe) stays in a # shared region from its own RO vmie_mem. Built only when armed (needs vmie). The in-guest
# separate repo and is NOT part of this delivery. # Windows producer is the vgpu-streamer cross-target above (same tree, shared ABI vgpu_stream.h).
if(VMSIG_WITH_VMIE) if(VMSIG_WITH_VMIE)
add_library(vgpu-perception SHARED add_library(vgpu-perception SHARED
src/si/vgpu-perception/discover.c src/si/vgpu-perception/discover.c
src/si/vgpu-perception/sample.c src/si/vgpu-perception/sample.c
src/si/vgpu-perception/control.c) src/si/vgpu-perception/control.c)
set_target_properties(vgpu-perception PROPERTIES
VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR}) # libvgpu-perception.so.0
target_include_directories(vgpu-perception target_include_directories(vgpu-perception
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src/si/vgpu-perception/include) PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src/si/vgpu-perception/include)
@@ -265,25 +267,30 @@ add_test(NAME memwrite COMMAND vmsig_memwritetest)
add_test(NAME cli COMMAND vmsig_cli) add_test(NAME cli COMMAND vmsig_cli)
# ---- install rules (for the .deb stage) ------------------------------------- # ---- install rules (for the .deb stage) -------------------------------------
option(VMSIG_INSTALL "Generate install() rules (daemon/lib/headers/unit/config)" OFF) option(VMSIG_INSTALL "Generate install() rules (per-component, for the .deb stages)" OFF)
if(VMSIG_INSTALL) if(VMSIG_INSTALL)
include(GNUInstallDirs) include(GNUInstallDirs)
install(TARGETS vmsigd RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}) # --- component `daemon`: the signaling delivery (package: vmsig). NO gpu lib here. ---
install(TARGETS vmsig LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) install(TARGETS vmsigd RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR} COMPONENT daemon)
if(TARGET vgpu-perception) # armed builds ship the host vgpu S-lib alongside install(TARGETS vmsig LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT daemon)
install(TARGETS vgpu-perception LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
# public contracts (signaling + absorbed SI host headers) under include/vmsig/
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/vmsig DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/vmsig COMPONENT daemon
FILES_MATCHING PATTERN "vmsig*.h" FILES_MATCHING PATTERN "vmsig*.h" PATTERN "vmctl.h")
PATTERN "vmctl.h"
PATTERN "vgpu_stream.h"
PATTERN "vgpu_perception.h")
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/packaging/systemd/vmsigd.service install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/packaging/systemd/vmsigd.service
DESTINATION lib/systemd/system) DESTINATION lib/systemd/system COMPONENT daemon)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/packaging/tmpfiles/vmsig.conf install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/packaging/tmpfiles/vmsig.conf
DESTINATION lib/tmpfiles.d) DESTINATION lib/tmpfiles.d COMPONENT daemon)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/packaging/config/vmsigd.conf install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/packaging/config/vmsigd.conf
DESTINATION /etc/vmsig) DESTINATION /etc/vmsig COMPONENT daemon)
# --- the host vgpu perception S-lib, SEPARATE from the daemon: runtime (versioned .so,
# package libvgpu-perception0) vs dev (namelink + headers, package libvgpu-perception-dev) ---
if(TARGET vgpu-perception)
install(TARGETS vgpu-perception
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT vgpu_runtime
NAMELINK_COMPONENT vgpu_dev)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/vgpu_perception.h
${CMAKE_CURRENT_SOURCE_DIR}/include/vgpu_stream.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/vmsig COMPONENT vgpu_dev)
endif()
endif() endif()
+45 -31
View File
@@ -1,46 +1,60 @@
# vmsig packaging — `make deb` builds the .deb over a `cmake --install` stage. # vmsig packaging — `make deb` builds TWO Debian packages from per-component install stages:
# Private values are NOT baked into the tree: pass them via the variables below (the # vmsig — the signaling daemon + library + headers + systemd unit
# defaults are neutral placeholders; CI overrides them from vars/secrets). # libvgpu-perception — the host-side vgpu perception S-lib (SEPARATE: not in vmsig)
# Private values are NOT baked in: pass them via the variables below (CI overrides them).
# #
# make deb LIBVMIE_PATH=/path/to/vmie VERSION=1.2.3 \ # make deb LIBVMIE_PATH=/path/to/vmie VERSION=1.2.3 MAINTAINER="Name <addr>"
# MAINTAINER="Name <addr>" DEPENDS="libc6, libvmie0"
VERSION ?= 0.0.0 VERSION ?= 0.0.0
MAINTAINER ?= vmsig packaging <root@localhost> MAINTAINER ?= vmsig packaging <root@localhost>
# libvmie0 is vmie's own runtime package (SONAME libvmie.so.0): libvmsig.so and # libvmie0 is vmie's runtime package (SONAME libvmie.so.0): both libvmsig.so and
# libvgpu-perception.so dynamically link it, so it is a HARD runtime dependency. # libvgpu-perception.so dynamically link it — a hard runtime dependency of each package.
DEPENDS ?= libc6, libvmie0 DEPENDS ?= libc6, libvmie0
ARCH ?= amd64 ARCH ?= amd64
LIBVMIE_PATH ?= LIBVMIE_PATH ?=
BUILD_DIR ?= .build-pkg BUILD_DIR ?= .build-pkg
STAGE ?= $(CURDIR)/dist/stage DIST ?= $(CURDIR)/dist
DIST ?= $(CURDIR)/dist
.PHONY: deb clean .PHONY: deb clean
# Armed package: the shipped daemon needs vmie for memctx. vmie stays an external dependency # vmie is found from a source tree (LIBVMIE_PATH) or, when empty, the installed libvmie-dev
# (package Depends on its runtime). vmie is found from a source tree (LIBVMIE_PATH) or, when # (system / CMAKE_PREFIX_PATH) — the CI path.
# that is empty, from the installed libvmie-dev (system / CMAKE_PREFIX_PATH) — the CI path.
deb: deb:
rm -rf $(STAGE)
cmake -S . -B $(BUILD_DIR) -DCMAKE_BUILD_TYPE=Release -DVMSIG_INSTALL=ON -DVMSIG_WITH_VMIE=ON \ cmake -S . -B $(BUILD_DIR) -DCMAKE_BUILD_TYPE=Release -DVMSIG_INSTALL=ON -DVMSIG_WITH_VMIE=ON \
$(if $(LIBVMIE_PATH),-DLIBVMIE_PATH=$(LIBVMIE_PATH),) $(if $(LIBVMIE_PATH),-DLIBVMIE_PATH=$(LIBVMIE_PATH),)
cmake --build $(BUILD_DIR) -j cmake --build $(BUILD_DIR) -j
DESTDIR=$(STAGE) cmake --install $(BUILD_DIR) --prefix /usr
mkdir -p $(STAGE)/DEBIAN
sed -e 's/@VERSION@/$(VERSION)/' \
-e 's|@MAINTAINER@|$(MAINTAINER)|' \
-e 's/@DEPENDS@/$(DEPENDS)/' \
packaging/deb/control.in > $(STAGE)/DEBIAN/control
cp packaging/deb/conffiles $(STAGE)/DEBIAN/conffiles
install -m 0755 packaging/deb/postinst $(STAGE)/DEBIAN/postinst
install -m 0755 packaging/deb/prerm $(STAGE)/DEBIAN/prerm
# strip inherited setgid from staged dirs (a setgid build tree => dpkg-deb rejects DEBIAN)
find $(STAGE) -type d -exec chmod g-s {} +
mkdir -p $(DIST) mkdir -p $(DIST)
dpkg-deb --root-owner-group --build $(STAGE) $(DIST)/vmsig_$(VERSION)_$(ARCH).deb # ---- package: vmsig (component `daemon`) ----
@echo "built: $(DIST)/vmsig_$(VERSION)_$(ARCH).deb" rm -rf $(DIST)/stage-daemon
DESTDIR=$(DIST)/stage-daemon cmake --install $(BUILD_DIR) --prefix /usr --component daemon
mkdir -p $(DIST)/stage-daemon/DEBIAN
sed -e 's/@VERSION@/$(VERSION)/' -e 's|@MAINTAINER@|$(MAINTAINER)|' -e 's/@DEPENDS@/$(DEPENDS)/' \
packaging/deb/vmsig/control.in > $(DIST)/stage-daemon/DEBIAN/control
cp packaging/deb/vmsig/conffiles $(DIST)/stage-daemon/DEBIAN/conffiles
install -m 0755 packaging/deb/vmsig/postinst $(DIST)/stage-daemon/DEBIAN/postinst
install -m 0755 packaging/deb/vmsig/prerm $(DIST)/stage-daemon/DEBIAN/prerm
find $(DIST)/stage-daemon -type d -exec chmod g-s {} +
dpkg-deb --root-owner-group --build $(DIST)/stage-daemon $(DIST)/vmsig_$(VERSION)_$(ARCH).deb
# ---- package: libvgpu-perception0 (component `vgpu_runtime` — versioned .so) ----
rm -rf $(DIST)/stage-vgpu0
DESTDIR=$(DIST)/stage-vgpu0 cmake --install $(BUILD_DIR) --prefix /usr --component vgpu_runtime
mkdir -p $(DIST)/stage-vgpu0/DEBIAN
sed -e 's/@VERSION@/$(VERSION)/' -e 's|@MAINTAINER@|$(MAINTAINER)|' -e 's/@DEPENDS@/$(DEPENDS)/' \
packaging/deb/vgpu0/control.in > $(DIST)/stage-vgpu0/DEBIAN/control
install -m 0755 packaging/deb/vgpu0/postinst $(DIST)/stage-vgpu0/DEBIAN/postinst
find $(DIST)/stage-vgpu0 -type d -exec chmod g-s {} +
dpkg-deb --root-owner-group --build $(DIST)/stage-vgpu0 $(DIST)/libvgpu-perception0_$(VERSION)_$(ARCH).deb
# ---- package: libvgpu-perception-dev (component `vgpu_dev` — namelink + headers) ----
rm -rf $(DIST)/stage-vgpu-dev
DESTDIR=$(DIST)/stage-vgpu-dev cmake --install $(BUILD_DIR) --prefix /usr --component vgpu_dev
mkdir -p $(DIST)/stage-vgpu-dev/DEBIAN
sed -e 's/@VERSION@/$(VERSION)/' -e 's|@MAINTAINER@|$(MAINTAINER)|' \
-e 's/@DEPENDS@/libvgpu-perception0 (= $(VERSION))/' \
packaging/deb/vgpu-dev/control.in > $(DIST)/stage-vgpu-dev/DEBIAN/control
find $(DIST)/stage-vgpu-dev -type d -exec chmod g-s {} +
dpkg-deb --root-owner-group --build $(DIST)/stage-vgpu-dev $(DIST)/libvgpu-perception-dev_$(VERSION)_$(ARCH).deb
@echo "built: vmsig + libvgpu-perception0 + libvgpu-perception-dev ($(VERSION))"
clean: clean:
rm -rf $(BUILD_DIR) $(DIST) rm -rf $(BUILD_DIR) $(DIST)
+10
View File
@@ -0,0 +1,10 @@
Package: libvgpu-perception-dev
Version: @VERSION@
Section: libdevel
Priority: optional
Architecture: amd64
Depends: @DEPENDS@
Maintainer: @MAINTAINER@
Description: Host-side vgpu perception library (development files)
Headers (vgpu_perception.h, vgpu_stream.h) and the linker namelink for
libvgpu-perception. Install this to build a control/shell against the perception API.
+12
View File
@@ -0,0 +1,12 @@
Package: libvgpu-perception0
Version: @VERSION@
Section: libs
Priority: optional
Architecture: amd64
Depends: @DEPENDS@
Maintainer: @MAINTAINER@
Description: Host-side vgpu perception library
Reads the in-guest vgpu shared region (frames, cursor, geometry) from the host over a
read-only guest-RAM handle and exposes a perception API. A Sensor-layer library consumed
by a control/shell, independent of the signaling daemon. This package ships the runtime
shared object (libvgpu-perception.so.0).
+10
View File
@@ -0,0 +1,10 @@
#!/bin/sh
set -e
case "$1" in
configure)
ldconfig || true
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
esac
exit 0
@@ -5,9 +5,9 @@ Priority: optional
Architecture: amd64 Architecture: amd64
Depends: @DEPENDS@ Depends: @DEPENDS@
Maintainer: @MAINTAINER@ Maintainer: @MAINTAINER@
Description: VM signaling coherence daemon and host SI libraries Description: VM signaling coherence daemon
vmsig serves a unix-socket control plane over the signaling layer for the VMs it vmsig serves a unix-socket control plane over the signaling layer for the VMs it
discovers: lifecycle/state, coherent guest address-space context handoff, and arbitrated discovers: lifecycle/state, coherent guest address-space context handoff, and arbitrated
input and memory-write actuation. Ships the daemon (vmsigd), the signaling library, the input and memory-write actuation. Ships the daemon (vmsigd), the signaling library, and a
host-side vgpu perception library, and a systemd unit. Configured via systemd unit. Configured via /etc/vmsig/vmsigd.conf. The host-side vgpu perception library
/etc/vmsig/vmsigd.conf. is a separate package (libvgpu-perception).