public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>
Subject: [pbs-devel] applied: [PATCH proxmox-backup] build: include pxar in static binary compilation and package
Date: Tue, 15 Apr 2025 12:17:02 +0200	[thread overview]
Message-ID: <1744712195.bwa5jpe4cd.astroid@yuna.none> (raw)
In-Reply-To: <20250410140015.279401-1-c.ebner@proxmox.com>

with a small Make-related follow-up

On April 10, 2025 4:00 pm, Christian Ebner wrote:
> The debian package providing the dynamically linked version of the
> proxmox-backup-client is packaged together with the pxar executable.
> 
> To be in line and for user convenience, include a statically linked
> version of pxar to the static package as well.
> 
> Renames STATIC_BIN env variable to STATIC_BINS to reflect that this
> now covers multiple binaries and store rustc flags in its own
> variable so they can be reused since `cargo rustc` does not allow
> invocations with multiple `--package` arguments at once.
> 
> Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
> ---
>  Makefile                                      | 19 ++++++++++++-------
>  ...oxmox-backup-client-static.bash-completion |  1 +
>  debian/proxmox-backup-client-static.install   |  2 ++
>  debian/rules                                  |  1 +
>  4 files changed, 16 insertions(+), 7 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index d74701462..2f81dc91d 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -50,6 +50,8 @@ COMPILEDIR := target/$(DEB_HOST_RUST_TYPE)/debug
>  STATIC_COMPILEDIR := $(STATIC_TARGET_DIR)/$(DEB_HOST_RUST_TYPE)/debug
>  endif
>  
> +STATIC_RUSTC_FLAGS := -C target-feature=+crt-static -L $(STATIC_COMPILEDIR)/deps-stubs/
> +
>  ifeq ($(valgrind), yes)
>  CARGO_BUILD_ARGS += --features valgrind
>  endif
> @@ -59,8 +61,8 @@ CARGO ?= cargo
>  COMPILED_BINS := \
>  	$(addprefix $(COMPILEDIR)/,$(USR_BIN) $(USR_SBIN) $(SERVICE_BIN) $(RESTORE_BIN))
>  
> -STATIC_BIN := \
> -	$(addprefix $(STATIC_COMPILEDIR)/,proxmox-backup-client-static)
> +STATIC_BINS := \
> +	$(addprefix $(STATIC_COMPILEDIR)/,proxmox-backup-client-static pxar-static)
>  
>  export DEB_VERSION DEB_VERSION_UPSTREAM
>  
> @@ -207,7 +209,7 @@ $(COMPILED_BINS) $(COMPILEDIR)/dump-catalog-shell-cli $(COMPILEDIR)/docgen: .do-
>  lint:
>  	cargo clippy -- -A clippy::all -D clippy::correctness
>  
> -install: $(COMPILED_BINS) $(STATIC_BIN)
> +install: $(COMPILED_BINS) $(STATIC_BINS)
>  	install -dm755 $(DESTDIR)$(BINDIR)
>  	install -dm755 $(DESTDIR)$(ZSH_COMPL_DEST)
>  	$(foreach i,$(USR_BIN), \
> @@ -227,6 +229,7 @@ install: $(COMPILED_BINS) $(STATIC_BIN)
>  	$(foreach i,$(SERVICE_BIN), \
>  	    install -m755 $(COMPILEDIR)/$(i) $(DESTDIR)$(LIBEXECDIR)/proxmox-backup/ ;)
>  	install -m755 $(STATIC_COMPILEDIR)/proxmox-backup-client $(DESTDIR)$(BINDIR)/proxmox-backup-client-static
> +	install -m755 $(STATIC_COMPILEDIR)/pxar $(DESTDIR)$(BINDIR)/pxar-static
>  	$(MAKE) -C www install
>  	$(MAKE) -C docs install
>  	$(MAKE) -C templates install
> @@ -244,11 +247,13 @@ upload: $(SERVER_DEB) $(CLIENT_DEB) $(RESTORE_DEB) $(DOC_DEB) $(STATIC_CLIENT_DE
>  
>  .PHONY: proxmox-backup-client-static
>  proxmox-backup-client-static:
> -	rm -f $(STATIC_BIN)
> -	$(MAKE) $(STATIC_BIN)
> +	rm -f $(STATIC_BINS)
> +	$(MAKE) $(STATIC_BINS)
>  
> -$(STATIC_BIN):
> +$(STATIC_BINS):
>  	mkdir -p $(STATIC_COMPILEDIR)/deps-stubs/ && \
>            echo '!<arch>' > $(STATIC_COMPILEDIR)/deps-stubs/libsystemd.a # workaround for to greedy linkage and proxmox-systemd
> +	$(CARGO) rustc $(CARGO_BUILD_ARGS) --package pxar-bin --bin pxar \
> +	  --target-dir $(STATIC_TARGET_DIR) -- $(STATIC_RUSTC_FLAGS)
>  	$(CARGO) rustc $(CARGO_BUILD_ARGS) --package proxmox-backup-client --bin proxmox-backup-client \
> -          --target-dir $(STATIC_TARGET_DIR) -- -C target-feature=+crt-static -L $(STATIC_COMPILEDIR)/deps-stubs/
> +	  --target-dir $(STATIC_TARGET_DIR) -- $(STATIC_RUSTC_FLAGS)
> diff --git a/debian/proxmox-backup-client-static.bash-completion b/debian/proxmox-backup-client-static.bash-completion
> index f8b9b4394..437360175 100644
> --- a/debian/proxmox-backup-client-static.bash-completion
> +++ b/debian/proxmox-backup-client-static.bash-completion
> @@ -1 +1,2 @@
>  debian/proxmox-backup-client.bc proxmox-backup-client
> +debian/pxar.bc pxar
> diff --git a/debian/proxmox-backup-client-static.install b/debian/proxmox-backup-client-static.install
> index f8a681d0a..6a913b677 100644
> --- a/debian/proxmox-backup-client-static.install
> +++ b/debian/proxmox-backup-client-static.install
> @@ -1,2 +1,4 @@
>  usr/share/man/man1/proxmox-backup-client.1
> +usr/share/man/man1/pxar.1
>  usr/share/zsh/vendor-completions/_proxmox-backup-client
> +usr/share/zsh/vendor-completions/_pxar
> diff --git a/debian/rules b/debian/rules
> index be7c93c2e..70cec4754 100755
> --- a/debian/rules
> +++ b/debian/rules
> @@ -49,6 +49,7 @@ override_dh_auto_install:
>  	    LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH)
>  	mkdir -p debian/proxmox-backup-client-static/usr/bin
>  	mv debian/tmp/usr/bin/proxmox-backup-client-static debian/proxmox-backup-client-static/usr/bin/proxmox-backup-client
> +	mv debian/tmp/usr/bin/pxar-static debian/proxmox-backup-client-static/usr/bin/pxar
>  
>  override_dh_installsystemd:
>  	dh_installsystemd -pproxmox-backup-server  proxmox-backup-daily-update.timer
> -- 
> 2.39.5
> 
> 
> 
> _______________________________________________
> pbs-devel mailing list
> pbs-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
> 
> 
> 


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


      reply	other threads:[~2025-04-15 10:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-10 14:00 [pbs-devel] " Christian Ebner
2025-04-15 10:17 ` Fabian Grünbichler [this message]

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=1744712195.bwa5jpe4cd.astroid@yuna.none \
    --to=f.gruenbichler@proxmox.com \
    --cc=pbs-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