public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH proxmox-perl-rs v2 0/3] makefile: reduce ambiguity for targets: all/install/upload
@ 2026-10-30 13:25 Elias Huhsovitz
  2026-10-30 13:25 ` [PATCH proxmox-perl-rs v2 1/3] makefile: use TARGET_DIR variable for install target Elias Huhsovitz
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Elias Huhsovitz @ 2026-10-30 13:25 UTC (permalink / raw)
  To: pve-devel; +Cc: Elias Huhsovitz

I encounted some minor inconsistencies in the Makefile:
* make install only installs from release dir (Even though 'make all'
  generates a debug build per default)
* File Fixup.pm is used inside a target but not specified as a
  prerequisite.
* unsued variable for upload target.

Some small patches to fix them.

Not implemented
---------------
Some minor fixes (such as replacing shell pwd with CURDIR) are not in
this series, because they have already been address in this patch
by Max:
https://lore.proxmox.com/pve-devel/20260807090809.101155-1-m.carrara@proxmox.com/

Changes v1->v2
--------------
* fix typo in commit message of patch 2
* utilize UPLOAD_DIST variable in common/pkg/Makefile

Previous versions:
------------------
v1: https://lore.proxmox.com/pve-devel/20261027104935.49190-1-e.huhsovitz@proxmox.com/

Summary of changes
------------------
Elias Huhsovitz (3):
  makefile: use TARGET_DIR variable for install target
  makefile: add Fixup.pm as prerequisite for $(BUILDDIR)
  makefile: use UPLOAD_DIST variable

 common/pkg/Makefile | 2 +-
 pmg-rs/Makefile     | 8 ++++----
 pve-rs/Makefile     | 8 ++++----
 3 files changed, 9 insertions(+), 9 deletions(-)

-- 
2.47.3





^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH proxmox-perl-rs v2 1/3] makefile: use TARGET_DIR variable for install target
  2026-10-30 13:25 [PATCH proxmox-perl-rs v2 0/3] makefile: reduce ambiguity for targets: all/install/upload Elias Huhsovitz
@ 2026-10-30 13:25 ` Elias Huhsovitz
  2026-10-30 13:25 ` [PATCH proxmox-perl-rs v2 2/3] makefile: add Fixup.pm as prerequisite for $(BUILDDIR) Elias Huhsovitz
  2026-10-30 13:25 ` [PATCH proxmox-perl-rs v2 3/3] makefile: use UPLOAD_DIST variable Elias Huhsovitz
  2 siblings, 0 replies; 4+ messages in thread
From: Elias Huhsovitz @ 2026-10-30 13:25 UTC (permalink / raw)
  To: pve-devel; +Cc: Elias Huhsovitz

Currently calling 'make all' and 'make install' fails, because make
builds a debug binary inside 'target/debug'. 'make install' is hardcoded
to always install the release binary inside of 'target/release/'.

Replace the hardcoded install path with the TARGET_DIR variable, so that
'make install' installs the binary compiled with 'make all'.

Release builds can still be compiled and installed by using
'BUILD_MODE=release make all' and 'BUILD_MODE=release make install'

Signed-off-by: Elias Huhsovitz <e.huhsovitz@proxmox.com>
---
 pmg-rs/Makefile | 4 ++--
 pve-rs/Makefile | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/pmg-rs/Makefile b/pmg-rs/Makefile
index a873143..d5063f9 100644
--- a/pmg-rs/Makefile
+++ b/pmg-rs/Makefile
@@ -71,9 +71,9 @@ Proxmox/Lib/PMG.pm $(PERLMOD_PACKAGE_FILES) &: Fixup.pm
 	$(PERLMOD_GENPACKAGE) $(PERLMOD_PACKAGES)
 
 .PHONY: install
-install: target/release/libpmg_rs.so Proxmox/Lib/PMG.pm $(PERLMOD_PACKAGE_FILES)
+install: target/$(TARGET_DIR)/libpmg_rs.so Proxmox/Lib/PMG.pm $(PERLMOD_PACKAGE_FILES)
 	install -d -m755 $(DESTDIR)$(PERL_INSTALLVENDORARCH)/auto
-	install -m644 target/release/libpmg_rs.so $(DESTDIR)$(PERL_INSTALLVENDORARCH)/auto/libpmg_rs.so
+	install -m644 target/$(TARGET_DIR)/libpmg_rs.so $(DESTDIR)$(PERL_INSTALLVENDORARCH)/auto/libpmg_rs.so
 	install -d -m755 $(DESTDIR)$(PERL_INSTALLVENDORLIB)
 	install -d -m755 $(DESTDIR)$(PERL_INSTALLVENDORLIB)/Proxmox/Lib
 	install -m644 Proxmox/Lib/PMG.pm $(DESTDIR)$(PERL_INSTALLVENDORLIB)/Proxmox/Lib/PMG.pm
diff --git a/pve-rs/Makefile b/pve-rs/Makefile
index bb1cd2d..1e3e792 100644
--- a/pve-rs/Makefile
+++ b/pve-rs/Makefile
@@ -89,9 +89,9 @@ check: all
 	$(MAKE) -C test test
 
 .PHONY: install
-install: target/release/libpve_rs.so Proxmox/Lib/PVE.pm $(PERLMOD_PACKAGE_FILES)
+install: target/$(TARGET_DIR)/libpve_rs.so Proxmox/Lib/PVE.pm $(PERLMOD_PACKAGE_FILES)
 	install -d -m755 $(DESTDIR)$(PERL_INSTALLVENDORARCH)/auto
-	install -m644 target/release/libpve_rs.so $(DESTDIR)$(PERL_INSTALLVENDORARCH)/auto/libpve_rs.so
+	install -m644 target/$(TARGET_DIR)/libpve_rs.so $(DESTDIR)$(PERL_INSTALLVENDORARCH)/auto/libpve_rs.so
 	install -d -m755 $(DESTDIR)$(PERL_INSTALLVENDORLIB)
 	install -d -m755 $(DESTDIR)$(PERL_INSTALLVENDORLIB)/Proxmox/Lib
 	install -m644 Proxmox/Lib/PVE.pm $(DESTDIR)$(PERL_INSTALLVENDORLIB)/Proxmox/Lib/PVE.pm
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH proxmox-perl-rs v2 2/3] makefile: add Fixup.pm as prerequisite for $(BUILDDIR)
  2026-10-30 13:25 [PATCH proxmox-perl-rs v2 0/3] makefile: reduce ambiguity for targets: all/install/upload Elias Huhsovitz
  2026-10-30 13:25 ` [PATCH proxmox-perl-rs v2 1/3] makefile: use TARGET_DIR variable for install target Elias Huhsovitz
@ 2026-10-30 13:25 ` Elias Huhsovitz
  2026-10-30 13:25 ` [PATCH proxmox-perl-rs v2 3/3] makefile: use UPLOAD_DIST variable Elias Huhsovitz
  2 siblings, 0 replies; 4+ messages in thread
From: Elias Huhsovitz @ 2026-10-30 13:25 UTC (permalink / raw)
  To: pve-devel; +Cc: Elias Huhsovitz

Fixup.pm is used inside of the $(BUILDDIR) target, but not listed as a
prerequisite. Modifying Fixup.pm will not result in re-generating
$(BUILDDIR).

Add Fixup.pm as a prerequisite.

Signed-off-by: Elias Huhsovitz <e.huhsovitz@proxmox.com>
---
 pmg-rs/Makefile | 2 +-
 pve-rs/Makefile | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pmg-rs/Makefile b/pmg-rs/Makefile
index d5063f9..5025aae 100644
--- a/pmg-rs/Makefile
+++ b/pmg-rs/Makefile
@@ -97,7 +97,7 @@ upload: $(DEBS)
 	git diff --exit-code --stat && git diff --exit-code --stat --staged
 	tar cf - $(DEBS) | ssh -X repoman@repo.proxmox.com upload --product pmg --dist $(DEB_DISTRIBUTION)
 
-$(BUILDDIR): src debian common/src Cargo.toml rustfmt.toml Makefile .cargo/config.toml
+$(BUILDDIR): src debian common/src Cargo.toml rustfmt.toml Makefile .cargo/config.toml Fixup.pm
 	rm -rf $(BUILDDIR) $(BUILDDIR).tmp
 	mkdir $(BUILDDIR).tmp
 	mkdir $(BUILDDIR).tmp/common
diff --git a/pve-rs/Makefile b/pve-rs/Makefile
index 1e3e792..3ae66c1 100644
--- a/pve-rs/Makefile
+++ b/pve-rs/Makefile
@@ -114,7 +114,7 @@ upload: $(DEBS)
 	git diff --exit-code --stat && git diff --exit-code --stat --staged
 	tar cf - $(DEBS) | ssh -X repoman@repo.proxmox.com upload --product pve --dist $(DEB_DISTRIBUTION)
 
-$(BUILDDIR): src debian test common/src Cargo.toml rustfmt.toml Makefile .cargo/config.toml
+$(BUILDDIR): src debian test common/src Cargo.toml rustfmt.toml Makefile .cargo/config.toml Fixup.pm
 	rm -rf $(BUILDDIR) $(BUILDDIR).tmp
 	mkdir $(BUILDDIR).tmp
 	mkdir $(BUILDDIR).tmp/common
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH proxmox-perl-rs v2 3/3] makefile: use UPLOAD_DIST variable
  2026-10-30 13:25 [PATCH proxmox-perl-rs v2 0/3] makefile: reduce ambiguity for targets: all/install/upload Elias Huhsovitz
  2026-10-30 13:25 ` [PATCH proxmox-perl-rs v2 1/3] makefile: use TARGET_DIR variable for install target Elias Huhsovitz
  2026-10-30 13:25 ` [PATCH proxmox-perl-rs v2 2/3] makefile: add Fixup.pm as prerequisite for $(BUILDDIR) Elias Huhsovitz
@ 2026-10-30 13:25 ` Elias Huhsovitz
  2 siblings, 0 replies; 4+ messages in thread
From: Elias Huhsovitz @ 2026-10-30 13:25 UTC (permalink / raw)
  To: pve-devel; +Cc: Elias Huhsovitz

The variable UPLOAD_DIST is never used in the upload target.

Utilize the UPLOAD_DIST variable. This mirrors the design of the
proxmox-backup Makefile and unties the upload dist name from the debian
dist name.

Signed-off-by: Elias Huhsovitz <e.huhsovitz@proxmox.com>
---
 common/pkg/Makefile | 2 +-
 pmg-rs/Makefile     | 2 +-
 pve-rs/Makefile     | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/pkg/Makefile b/common/pkg/Makefile
index 5a537f9..1e63bfa 100644
--- a/common/pkg/Makefile
+++ b/common/pkg/Makefile
@@ -69,7 +69,7 @@ upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION)
 upload: $(DEB)
 	# check if working directory is clean
 	git diff --exit-code --stat && git diff --exit-code --stat --staged
-	tar cf - $(DEB) | ssh -X repoman@repo.proxmox.com upload --product pve,pmg --dist $(DEB_DISTRIBUTION)
+	tar cf - $(DEB) | ssh -X repoman@repo.proxmox.com upload --product pve,pmg --dist $(UPLOAD_DIST)
 
 clean:
 	rm -f *.deb *.dsc *.tar.* *.build *.buildinfo *.changes
diff --git a/pmg-rs/Makefile b/pmg-rs/Makefile
index 5025aae..f5d31a2 100644
--- a/pmg-rs/Makefile
+++ b/pmg-rs/Makefile
@@ -95,7 +95,7 @@ upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION)
 upload: $(DEBS)
 	# check if working directory is clean
 	git diff --exit-code --stat && git diff --exit-code --stat --staged
-	tar cf - $(DEBS) | ssh -X repoman@repo.proxmox.com upload --product pmg --dist $(DEB_DISTRIBUTION)
+	tar cf - $(DEBS) | ssh -X repoman@repo.proxmox.com upload --product pmg --dist $(UPLOAD_DIST)
 
 $(BUILDDIR): src debian common/src Cargo.toml rustfmt.toml Makefile .cargo/config.toml Fixup.pm
 	rm -rf $(BUILDDIR) $(BUILDDIR).tmp
diff --git a/pve-rs/Makefile b/pve-rs/Makefile
index 3ae66c1..f9ba49c 100644
--- a/pve-rs/Makefile
+++ b/pve-rs/Makefile
@@ -112,7 +112,7 @@ upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION)
 upload: $(DEBS)
 	# check if working directory is clean
 	git diff --exit-code --stat && git diff --exit-code --stat --staged
-	tar cf - $(DEBS) | ssh -X repoman@repo.proxmox.com upload --product pve --dist $(DEB_DISTRIBUTION)
+	tar cf - $(DEBS) | ssh -X repoman@repo.proxmox.com upload --product pve --dist $(UPLOAD_DIST)
 
 $(BUILDDIR): src debian test common/src Cargo.toml rustfmt.toml Makefile .cargo/config.toml Fixup.pm
 	rm -rf $(BUILDDIR) $(BUILDDIR).tmp
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-10-30 13:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-30 13:25 [PATCH proxmox-perl-rs v2 0/3] makefile: reduce ambiguity for targets: all/install/upload Elias Huhsovitz
2026-10-30 13:25 ` [PATCH proxmox-perl-rs v2 1/3] makefile: use TARGET_DIR variable for install target Elias Huhsovitz
2026-10-30 13:25 ` [PATCH proxmox-perl-rs v2 2/3] makefile: add Fixup.pm as prerequisite for $(BUILDDIR) Elias Huhsovitz
2026-10-30 13:25 ` [PATCH proxmox-perl-rs v2 3/3] makefile: use UPLOAD_DIST variable Elias Huhsovitz

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