public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Hannes Laimer <h.laimer@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH pve-cluster 08/12] buildsys: link pmxcfs against the rust notify staticlib
Date: Thu, 22 Oct 2026 16:22:01 +0200	[thread overview]
Message-ID: <20261022142205.930536-9-h.laimer@proxmox.com> (raw)
In-Reply-To: <20261022142205.930536-1-h.laimer@proxmox.com>

The C convenience library calls nothing in the staticlib, so the
database tool and the test programs link as before. The pmxcfs
Makefile builds the staticlib itself, so a standalone make in
src/pmxcfs keeps working. The staticlib's prerequisites come from the
dependency file cargo writes, so a changed Rust source rebuilds it.

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
---
 src/pmxcfs/Makefile | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/src/pmxcfs/Makefile b/src/pmxcfs/Makefile
index 90bc6a5..e05b4e3 100644
--- a/src/pmxcfs/Makefile
+++ b/src/pmxcfs/Makefile
@@ -1,3 +1,4 @@
+include ../defines.mk
 
 DEPENDENCIES=libcpg libcmap libcorosync_common libquorum libqb glib-2.0 fuse sqlite3 librrd
 
@@ -12,9 +13,18 @@ CFLAGS += -I../rust/pmxcfs-ffi/include
 
 LDFLAGS += -Wl,-z,relro $(shell pkg-config --libs $(DEPENDENCIES))
 
+NOTIFY_LIB := $(abspath ../rust/$(RUST_COMPILE_DIR)/libpmxcfs_ffi.a)
+# from `cargo rustc -p pmxcfs-ffi --release -- --print native-static-libs`
+NOTIFY_LIBS := -lgcc_s -lutil -lrt -lpthread -lm -ldl -lc
+
 AR = ar
 ARFLAGS = crs
 
+-include $(NOTIFY_LIB:.a=.d)
+# a source file deleted since cargo wrote the dep file has no rule, and make
+# would stop before the rebuild that drops it from the list
+%.rs: ;
+
 .c.o:
 	$(CC) $(CFLAGS) -c -o $@ $< -MMD -MT $@ -MF $@.d
 
@@ -26,9 +36,14 @@ libpmxcfs.a: cfs-utils.o memdb.o database.o
 libpmxcfs.a:
 	$(AR) $(ARFLAGS) $@ $^
 
-pmxcfs: pmxcfs.o libpmxcfs.a
-	$(CC) -o $@ $^ $(LDFLAGS)
+pmxcfs: pmxcfs.o libpmxcfs.a $(NOTIFY_LIB)
+	$(CC) -o $@ $^ $(LDFLAGS) $(NOTIFY_LIBS)
 
+$(NOTIFY_LIB): ../rust/Cargo.toml ../rust/.cargo/config.toml \
+	../rust/pmxcfs-ffi/Cargo.toml ../rust/pmxcfs-notify/Cargo.toml
+	$(MAKE) -C ../rust all
+.PHONY: notify-lib
+notify-lib: $(NOTIFY_LIB)
 
 create_pmxcfs_db: create_pmxcfs_db.o libpmxcfs.a
 	$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
-- 
2.47.3





  parent reply	other threads:[~2026-10-22 14:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-22 14:21 [PATCH cluster 00/12] pmxcfs: add a change notification socket Hannes Laimer
2026-10-22 14:21 ` [PATCH pve-cluster 01/12] buildsys: add rust workspace under src/rust Hannes Laimer
2026-10-22 14:21 ` [PATCH pve-cluster 02/12] rust: notify: add path templates with placeholder capture Hannes Laimer
2026-10-22 14:21 ` [PATCH pve-cluster 03/12] rust: notify: add the wire protocol Hannes Laimer
2026-10-22 14:21 ` [PATCH pve-cluster 04/12] rust: notify: add subscription matching Hannes Laimer
2026-10-22 14:21 ` [PATCH pve-cluster 05/12] rust: notify: add the socket server Hannes Laimer
2026-10-22 14:21 ` [PATCH pve-cluster 06/12] rust: ffi: add C ABI staticlib for pmxcfs Hannes Laimer
2026-10-22 14:22 ` [PATCH pve-cluster 07/12] pmxcfs: memdb: add change notification hook Hannes Laimer
2026-10-22 14:22 ` Hannes Laimer [this message]
2026-10-22 14:22 ` [PATCH pve-cluster 09/12] pmxcfs: notify: emit change events over the notification socket Hannes Laimer
2026-10-22 14:22 ` [PATCH pve-cluster 10/12] cfs: add perl client for the change " Hannes Laimer
2026-10-22 14:22 ` [PATCH pve-cluster 11/12] cfs: add hook registry for change notification consumers Hannes Laimer
2026-10-22 14:22 ` [PATCH pve-cluster 12/12] cfs: add runner executing cluster change hooks in children Hannes Laimer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261022142205.930536-9-h.laimer@proxmox.com \
    --to=h.laimer@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal