From patchwork Tue Feb 1 13:52:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tremer X-Patchwork-Id: 5029 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4Jp5wv4mXVz3wp0 for ; Tue, 1 Feb 2022 13:53:03 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4Jp5wm2Sgnz5FP; Tue, 1 Feb 2022 13:52:56 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4Jp5wl3HgWz32Kc; Tue, 1 Feb 2022 13:52:55 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4Jp5wk1kqBz2ytv for ; Tue, 1 Feb 2022 13:52:54 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4Jp5wk0jq9z4YQ; Tue, 1 Feb 2022 13:52:54 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1643723574; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rNqtbsu7dZ7tV426PKqjtNUBMYDSeJjuKS3mEAQ497M=; b=hs4ZFwQlYRxxHfgkdLt5pVY5M7MbvlQW8UzESh4/Rt7OOydNPe7DK6kQIu7HUI/lSFO/eY Z8hXbcohnl+hujBw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1643723574; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rNqtbsu7dZ7tV426PKqjtNUBMYDSeJjuKS3mEAQ497M=; b=bnapvaGeJfHChXZd7XTABQsw+Ox7CBsYhLo1IlSp1WqnROdQy2XmA9SvDsSlWEFYaflarZ 4YOryYk9s858fAjeg9ksuV7Lnb2Fcfq7NiRnKKRPKi+/Z4pi5pYrAGVe8KtntpPwn4kndZ eIY3Mz/gsLrXSVOwgj5ydGXoez/Cd4YgcW/2Go5hc0ElGdcyp44IVp/rhNhA5De8RzJKKQ aAtGUeSEaR+anZiLjjg6V9jSbNIRivmfKNSu6amWFjIrhy3ONgMenKACnJ758corWw4/rL oKDlHc3o2mYZuYdz/68PiW6DqEhz1MwEny8kU0NF2gV9mZoSzWxeV6ltCGD9BQ== From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH 05/10] rust: Avoid requiring development dependencies Date: Tue, 1 Feb 2022 13:52:41 +0000 Message-Id: <20220201135246.4096955-5-michael.tremer@ipfire.org> In-Reply-To: <20220201135246.4096955-1-michael.tremer@ipfire.org> References: <20220201135246.4096955-1-michael.tremer@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Tremer Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Cargo will always require all depenendencies, even if the package is not being built against them. In order to avoid that, we will need the nightly build of the Rust compiler which supports skipping those dependencies. Signed-off-by: Michael Tremer --- lfs/Config | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/lfs/Config b/lfs/Config index a1e77f72c..fb5745df0 100644 --- a/lfs/Config +++ b/lfs/Config @@ -184,7 +184,13 @@ export CARGO_CONFIG CARGO = \ CARGOPATH=$(CARGO_PATH) \ - cargo + RUSTC_BOOTSTRAP=1 \ + cargo \ + --offline + +CARGO_OPTIONS = \ + $(MAKETUNING) \ + -Z avoid-dev-deps define CARGO_PREPARE mkdir -p $(CARGO_PATH) && \ @@ -195,11 +201,11 @@ endef CARGO_BUILD = \ $(CARGO) \ build \ - $(MAKETUNING) \ - --release + --release \ + $(CARGO_OPTIONS) # Checks whether this crate has a right taregt -CARGO_TARGET_CHECK = cargo metadata --format-version 1 | \ +CARGO_TARGET_CHECK = $(CARGO) metadata --format-version 1 --no-deps | \ jq -e ".packages[].targets[].kind | any(. == \"$(1)\")" | grep -q "true" define CARGO_INSTALL @@ -214,7 +220,7 @@ define CARGO_INSTALL echo "{\"files\":{},\"package\":\"\"}" > $(CRATE_PATH)/.cargo-checksum.json; \ fi && \ if $(call CARGO_TARGET_CHECK,bin); then \ - $(CARGO) install --no-track --path .; \ + $(CARGO) install $(CARGO_OPTIONS) --no-track --path .; \ fi endef