From: Michael Tremer <michael.tremer@ipfire.org>
To: development@lists.ipfire.org
Subject: [PATCH 05/10] rust: Avoid requiring development dependencies
Date: Tue, 01 Feb 2022 13:52:41 +0000 [thread overview]
Message-ID: <20220201135246.4096955-5-michael.tremer@ipfire.org> (raw)
In-Reply-To: <20220201135246.4096955-1-michael.tremer@ipfire.org>
[-- Attachment #1: Type: text/plain, Size: 1496 bytes --]
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 <michael.tremer(a)ipfire.org>
---
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
--
2.30.2
next prev parent reply other threads:[~2022-02-01 13:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-01 13:52 [PATCH 01/10] make.sh: Set a good default for rustc flags Michael Tremer
2022-02-01 13:52 ` [PATCH 02/10] jq: New package Michael Tremer
2022-02-01 13:52 ` [PATCH 03/10] make.sh: Add some commands to build Rust packages Michael Tremer
2022-02-01 13:52 ` [PATCH 04/10] rust: List all files copied Michael Tremer
2022-02-01 13:52 ` Michael Tremer [this message]
2022-02-01 13:52 ` [PATCH 06/10] rust: Add switch to skip bin check Michael Tremer
2022-02-01 13:52 ` [PATCH 07/10] rust: Enable more checks for when to install package files Michael Tremer
2022-02-01 13:52 ` [PATCH 08/10] rust: Add script to automatically generate packages Michael Tremer
2022-02-01 13:52 ` [PATCH 09/10] rust: Upgrade to nightly build from today Michael Tremer
2022-02-01 13:52 ` [PATCH 10/10] Config: Remove /root/.cargo Michael Tremer
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=20220201135246.4096955-5-michael.tremer@ipfire.org \
--to=michael.tremer@ipfire.org \
--cc=development@lists.ipfire.org \
/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