public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-backup 1/2] build: ensure wrapper config is picked up
@ 2024-07-10 12:29 Fabian Grünbichler
  2024-07-10 12:29 ` [pbs-devel] [PATCH proxmox-backup 2/2] build: call dh-cargo-built-using Fabian Grünbichler
  2024-07-18 10:38 ` [pbs-devel] applied: [PATCH proxmox-backup 1/2] build: ensure wrapper config is picked up Thomas Lamprecht
  0 siblings, 2 replies; 3+ messages in thread
From: Fabian Grünbichler @ 2024-07-10 12:29 UTC (permalink / raw)
  To: pbs-devel

`cargo build` and `cargo install` pick up different config files, by symlinking
the wrapper config into a place with higher precedence than the one in the
top-level git repo dir, we ensure the package build actually picks up the
desired config instead of the one intended for quick dev builds.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
---
 debian/rules | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/debian/rules b/debian/rules
index a82c3e12f..a03fe11ba 100755
--- a/debian/rules
+++ b/debian/rules
@@ -28,6 +28,11 @@ override_dh_auto_configure:
 	@perl -ne 'if (/^version\s*=\s*"(\d+(?:\.\d+)+)"/) { my $$v_cargo = $$1; my $$v_deb = "$(DEB_VERSION_UPSTREAM)"; \
 	    die "ERROR: d/changelog <-> Cargo.toml version mismatch: $$v_cargo != $$v_deb\n" if $$v_cargo ne $$v_deb; exit(0); }' Cargo.toml
 	$(CARGO) prepare-debian $(CURDIR)/debian/cargo_registry --link-from-system
+	# `cargo build` and `cargo install` have different config precedence, symlink
+	# the wrapper config into a place where `build` picks it up as well..
+	# https://doc.rust-lang.org/cargo/commands/cargo-install.html#configuration-discovery
+	mkdir -p .cargo
+	ln -s $(CARGO_HOME)/config.toml $(CURDIR)/.cargo/config.toml
 	dh_auto_configure
 
 override_dh_auto_build:
-- 
2.39.2



_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel

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

* [pbs-devel] [PATCH proxmox-backup 2/2] build: call dh-cargo-built-using
  2024-07-10 12:29 [pbs-devel] [PATCH proxmox-backup 1/2] build: ensure wrapper config is picked up Fabian Grünbichler
@ 2024-07-10 12:29 ` Fabian Grünbichler
  2024-07-18 10:38 ` [pbs-devel] applied: [PATCH proxmox-backup 1/2] build: ensure wrapper config is picked up Thomas Lamprecht
  1 sibling, 0 replies; 3+ messages in thread
From: Fabian Grünbichler @ 2024-07-10 12:29 UTC (permalink / raw)
  To: pbs-devel

to record the linked dependencies/crates for future analysis.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
---

Notes:
    REQUIRES some of our crates to be converted to machine-readable copyright and
    bumped before it can be applied!
    
    /usr/share/cargo/bin/dh-cargo-built-using: abort: Not in machine-readable format: /usr/share/doc/librust-proxmox-acme-dev/copyright
    /usr/share/cargo/bin/dh-cargo-built-using: abort: Not in machine-readable format: /usr/share/doc/librust-proxmox-borrow-dev/copyright
    /usr/share/cargo/bin/dh-cargo-built-using: abort: Not in machine-readable format: /usr/share/doc/librust-proxmox-fuse-dev/copyright
    /usr/share/cargo/bin/dh-cargo-built-using: abort: Not in machine-readable format: /usr/share/doc/librust-proxmox-uuid-dev/copyright
    /usr/share/cargo/bin/dh-cargo-built-using: abort: Not in machine-readable format: /usr/share/doc/librust-pxar-dev/copyright

 debian/rules | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/debian/rules b/debian/rules
index a03fe11ba..ed93ab1ea 100755
--- a/debian/rules
+++ b/debian/rules
@@ -48,6 +48,9 @@ override_dh_auto_install:
 	    PROXY_USER=backup \
 	    LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH)
 
+execute_after_dh_auto_install:
+	/usr/share/cargo/bin/dh-cargo-built-using $(DEB_CARGO_PACKAGE)
+
 override_dh_installsystemd:
 	dh_installsystemd -pproxmox-backup-server  proxmox-backup-daily-update.timer
 	# note: we start/try-reload-restart services manually in postinst
-- 
2.39.2



_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel

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

* [pbs-devel] applied: [PATCH proxmox-backup 1/2] build: ensure wrapper config is picked up
  2024-07-10 12:29 [pbs-devel] [PATCH proxmox-backup 1/2] build: ensure wrapper config is picked up Fabian Grünbichler
  2024-07-10 12:29 ` [pbs-devel] [PATCH proxmox-backup 2/2] build: call dh-cargo-built-using Fabian Grünbichler
@ 2024-07-18 10:38 ` Thomas Lamprecht
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Lamprecht @ 2024-07-18 10:38 UTC (permalink / raw)
  To: Proxmox Backup Server development discussion, Fabian Grünbichler

Am 10/07/2024 um 14:29 schrieb Fabian Grünbichler:
> `cargo build` and `cargo install` pick up different config files, by symlinking
> the wrapper config into a place with higher precedence than the one in the
> top-level git repo dir, we ensure the package build actually picks up the
> desired config instead of the one intended for quick dev builds.
> 
> Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
> ---
>  debian/rules | 5 +++++
>  1 file changed, 5 insertions(+)
> 
>

applied this one, thanks!

Fine with the other one, just ping it once all relevant d/copyright files
got transformed.


_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel

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

end of thread, other threads:[~2024-07-18 10:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-10 12:29 [pbs-devel] [PATCH proxmox-backup 1/2] build: ensure wrapper config is picked up Fabian Grünbichler
2024-07-10 12:29 ` [pbs-devel] [PATCH proxmox-backup 2/2] build: call dh-cargo-built-using Fabian Grünbichler
2024-07-18 10:38 ` [pbs-devel] applied: [PATCH proxmox-backup 1/2] build: ensure wrapper config is picked up Thomas Lamprecht

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