From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id C8C941FF16C for ; Fri, 16 Aug 2024 18:19:35 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 0C7C51A904; Fri, 16 Aug 2024 18:19:52 +0200 (CEST) From: Christoph Heiss To: pve-devel@lists.proxmox.com Date: Fri, 16 Aug 2024 18:19:03 +0200 Message-ID: <20240816161942.2044889-1-c.heiss@proxmox.com> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.031 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [country.pl, proxmox.com, spice-vdagent.sh] Subject: [pve-devel] [RFC PATCH installer] buildsys: add static version of proxmox-auto-install-assistant X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" This adds a separate debian package to the build, containing a statically-built version of `proxmox-auto-install-assistant`, as was suggested in #4788 [0] (for proxmox-backup-client), separately by Thomas also. Rust nowadays makes building static binaries pretty easy, even when OpenSSL etc. is used. NB: When run through lintian, the resulting package produces the `shared-library-lacks-prerequisites`, which overalls seems rather irrelevant (or even bogus?) in our case [1]. [0] https://bugzilla.proxmox.com/show_bug.cgi?id=4788 [1] https://lists.debian.org/debian-lint-maint/2023/02/msg00045.html Signed-off-by: Christoph Heiss --- Marked RFC to see if the packaging is overall sane -- I haven't done a lot of (Debian) packaging yet, so please don't hesitate with suggestions. Makefile | 22 +++++++++++++++---- debian/control | 10 +++++++++ ...xmox-auto-install-assistant-static.install | 1 + ...roxmox-auto-install-assistant-static.links | 1 + 4 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 debian/proxmox-auto-install-assistant-static.install create mode 100644 debian/proxmox-auto-install-assistant-static.links diff --git a/Makefile b/Makefile index e96a0f2..d288e82 100644 --- a/Makefile +++ b/Makefile @@ -5,14 +5,19 @@ BUILDDIR ?= $(PACKAGE)-$(DEB_VERSION_UPSTREAM) DEB=$(PACKAGE)_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb ASSISTANT_DEB=proxmox-auto-install-assistant_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb +ASSISTANT_STATIC_DEB=proxmox-auto-install-assistant-static_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb DSC=$(PACKAGE)_$(DEB_VERSION).dsc CARGO ?= cargo +CARGO_STATIC_TARGET ?= x86_64-unknown-linux-gnu + ifeq ($(BUILD_MODE), release) CARGO_BUILD_ARGS += --release CARGO_COMPILEDIR := target/release +CARGO_STATIC_COMPILEDIR := target/$(CARGO_STATIC_TARGET)/release else CARGO_COMPILEDIR := target/debug +CARGO_STATIC_COMPILEDIR := target/$(CARGO_STATIC_TARGET)/debug endif INSTALLER_SOURCES=$(shell git ls-files) country.dat @@ -71,9 +76,10 @@ country.dat: country.pl deb: $(DEB) $(ASSISTANT_DEB): $(DEB) +$(ASSISTANT_STATIC_DEB): auto-install-assistant-static $(DEB): $(BUILDDIR) cd $(BUILDDIR); dpkg-buildpackage -b -us -uc - lintian $(DEB) + lintian $(DEB) $(ASSISTANT_STATIC_DEB) test-$(DEB): $(INSTALLER_SOURCES) rsync --exclude='test*.img' --exclude='*.deb' --exclude='build' -a * build @@ -109,7 +115,7 @@ VARLIBDIR=$(DESTDIR)/var/lib/proxmox-installer HTMLDIR=$(VARLIBDIR)/html/common .PHONY: install -install: $(INSTALLER_SOURCES) $(COMPILED_BINS) +install: $(INSTALLER_SOURCES) $(COMPILED_BINS) auto-install-assistant-static $(MAKE) -C banner install $(MAKE) -C Proxmox install install -D -m 644 interfaces $(DESTDIR)/etc/network/interfaces @@ -120,6 +126,7 @@ install: $(INSTALLER_SOURCES) $(COMPILED_BINS) install -D -m 755 proxinstall $(DESTDIR)/usr/bin/proxinstall install -D -m 755 proxmox-low-level-installer $(DESTDIR)/$(BINDIR)/proxmox-low-level-installer $(foreach i,$(USR_BIN), install -m755 $(CARGO_COMPILEDIR)/$(i) $(DESTDIR)$(BINDIR)/ ;) + install -D -m 755 $(CARGO_STATIC_COMPILEDIR)/proxmox-auto-install-assistant $(DESTDIR)$(BINDIR)/proxmox-auto-install-assistant-static install -D -m 755 checktime $(DESTDIR)/usr/bin/checktime install -D -m 644 xinitrc $(DESTDIR)/.xinitrc install -D -m 755 spice-vdagent.sh $(DESTDIR)/.spice-vdagent.sh @@ -134,13 +141,20 @@ cargo-build: --package proxmox-auto-install-assistant --bin proxmox-auto-install-assistant \ --package proxmox-chroot --bin proxmox-chroot $(CARGO_BUILD_ARGS) +.PHONY: auto-install-assistant-static +auto-install-assistant-static: + RUSTFLAGS='-C target-feature=+crt-static' cargo build \ + --package proxmox-auto-install-assistant \ + --target $(CARGO_STATIC_TARGET) $(CARGO_BUILD_ARGS) + %-banner.png: %-banner.svg rsvg-convert -o $@ $< .PHONY: upload upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION) -upload: $(DEB) $(ASSISTANT_DEB) - tar cf - $(DEB) $(ASSISTANT_DEB) | ssh -X repoman@repo.proxmox.com -- upload --product pve,pmg,pbs --dist $(UPLOAD_DIST) +upload: $(DEB) $(ASSISTANT_DEB) $(ASSISTANT_STATIC_DEB) + tar cf - $(DEB) $(ASSISTANT_DEB) $(ASSISTANT_STATIC_DEB) \ + | ssh -X repoman@repo.proxmox.com -- upload --product pve,pmg,pbs --dist $(UPLOAD_DIST) %.img: truncate -s 2G $@ diff --git a/debian/control b/debian/control index 04b0c6e..6bf3cd5 100644 --- a/debian/control +++ b/debian/control @@ -61,3 +61,13 @@ Description: Assistant to help with automated installations Provides a helper that can assist with creating an answer file for a automated installation of a Proxmox project, and preparing a official ISO image to use this answer file. + +Package: proxmox-auto-install-assistant-static +Architecture: any +Recommends: xorriso, +Conflicts: proxmox-auto-install-assistant +Provides: proxmox-auto-install-assistant +Description: Assistant to help with automated installations - static build + Provides a helper that can assist with creating an answer file for a automated + installation of a Proxmox project, and preparing a official ISO image to use + this answer file. diff --git a/debian/proxmox-auto-install-assistant-static.install b/debian/proxmox-auto-install-assistant-static.install new file mode 100644 index 0000000..abd2c64 --- /dev/null +++ b/debian/proxmox-auto-install-assistant-static.install @@ -0,0 +1 @@ +usr/bin/proxmox-auto-install-assistant-static diff --git a/debian/proxmox-auto-install-assistant-static.links b/debian/proxmox-auto-install-assistant-static.links new file mode 100644 index 0000000..28e003c --- /dev/null +++ b/debian/proxmox-auto-install-assistant-static.links @@ -0,0 +1 @@ +usr/bin/proxmox-auto-install-assistant-static usr/bin/proxmox-auto-install-assistant -- 2.45.2 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel