public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: "Proxmox Backup Server development discussion"
	<pbs-devel@lists.proxmox.com>,
	"Fabian Grünbichler" <f.gruenbichler@proxmox.com>
Subject: Re: [pbs-devel] [RFC proxmox-backup] buildsys: build and package statically linked client binary
Date: Wed, 9 Apr 2025 11:53:16 +0200	[thread overview]
Message-ID: <ad4fdc36-cc25-425b-bf1e-89a8fc254a34@proxmox.com> (raw)
In-Reply-To: <1744188032.t8zilwjq6p.astroid@yuna.none>

Am 09.04.25 um 11:09 schrieb Fabian Grünbichler:
> I think the following going in first and rebasing on top might make
> sense:
> 
> ----8<----
> commit 1793d3cd1ee9e1175354350f7c3dde92c9ed4413
> Author:     Fabian Grünbichler <f.gruenbichler@proxmox.com>
> AuthorDate: Wed Apr 9 10:32:20 2025 +0200
> Commit:     Fabian Grünbichler <f.gruenbichler@proxmox.com>
> CommitDate: Wed Apr 9 10:32:20 2025 +0200
> 
>     build: always set --target
>     
>     since it affects whether cargo puts build artifacts directly into
>     target/debug (or target/release) or into a target-specific
>     sub-directory.
>     
>     the package build will always pass `--target $(DEB_HOST_RUST_TYPE)`,
>     since it invokes the cargo wrapper in /usr/share/cargo/bin/cargo, so
>     this change unifies the behaviour across plain `make` and `make
>     deb`.
> 
>     direct calls to `cargo build/test/..` will still work as before.
>     
>     Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
> 
> diff --git a/Makefile b/Makefile
> index 428ef40b9..2543b1e37 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1,8 +1,10 @@
>  include /usr/share/dpkg/default.mk
> +include /usr/share/rustc/architecture.mk
>  include defines.mk
>  
>  PACKAGE := proxmox-backup
>  ARCH := $(DEB_BUILD_ARCH)
> +export DEB_HOST_RUST_TYPE
>  
>  SUBDIRS := etc www docs templates
>  
> @@ -39,10 +41,11 @@ SUBCRATES != cargo metadata --no-deps --format-version=1 \
>  STATIC_TARGET ?= x86_64-unknown-linux-gnu
>  
>  ifeq ($(BUILD_MODE), release)
> -CARGO_BUILD_ARGS += --release
> +CARGO_BUILD_ARGS += --release --target $(DEB_HOST_RUST_TYPE)
>  COMPILEDIR := target/$(DEB_HOST_RUST_TYPE)/release
>  STATIC_COMPILEDIR := target/$(STATIC_TARGET)/release
>  else
> +CARGO_BUILD_ARGS += --target $(DEB_HOST_RUST_TYPE)
>  COMPILEDIR := target/$(DEB_HOST_RUST_TYPE)/debug
>  STATIC_COMPILEDIR := target/$(STATIC_TARGET)/debug
>  endif
>  ---->8----
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>

feel free to push directly.


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

      parent reply	other threads:[~2025-04-09  9:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-09  8:18 Christian Ebner
2025-04-09  9:09 ` Fabian Grünbichler
2025-04-09  9:22   ` Christian Ebner
2025-04-09  9:53   ` Thomas Lamprecht [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=ad4fdc36-cc25-425b-bf1e-89a8fc254a34@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=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