From patchwork Tue Mar 31 08:10:06 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quirin Gylstorff X-Patchwork-Id: 4994 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Tue, 31 Mar 2026 10:10:31 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-qv1-f61.google.com (mail-qv1-f61.google.com [209.85.219.61]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 62V8AUG1011174 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 31 Mar 2026 10:10:30 +0200 Received: by mail-qv1-f61.google.com with SMTP id 6a1803df08f44-89cc1d6dbe4sf37320726d6.3 for ; Tue, 31 Mar 2026 01:10:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1774944623; cv=pass; d=google.com; s=arc-20240605; b=JL4cEC6I4C/rPItDCYY7N0Rtl4x6RUjf2/zIbZP3rk68Lk7rszgXlQa+E0jIDw5jcs 7UuKIbGqQwNdP/HugzEyGCTi84npC3bAbMPWMWdF9FgLtchECm/vho9mO1HwxS7XoISy bllJGaB6T/iPI2vEmuNTq5tXP5+hzMzsmF48Q4KMjahYdsvmh1EroaXi53hPSaft35e/ 2cCGi09js2+bb0l4vXq9KrpjLcGFUYYAV6qj+9p2rr6bNKAb0hxZayfOH7ClCW4SfWFg 8ICA3+PeZ1eQMQQredWOYnASi4UIQvbxN+2s14PNu0cP2PZx/gQQOMvJ/Kmt+acjvCeJ KKIA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:feedback-id:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=iD9YG11neghaW/wMBoRsmBqTDjmzV2Ln0UDRO4nT6vw=; fh=t+nNMlHXvYpqZS3G3GUcyHNqearFrSyd7uudfs3irxA=; b=YpQ1LyVTGm8dEG3UEBcuEeWbYODFxepuR1+RoJziuY3bYSQY4ThV6zZ1tTqmU4FK24 9aGwI/nY+ApmolkkW1fciAW1h5H9XJ1pGYS2TTLYPTHdgSRoZ1Ix/KJeLZSFMJFnbQgC TBp1D85CQK/ctoh0sGvOfJHh3enlMcrx6pg0ltQu/0vV9COCo1T2dkcNuMLaVcTxMgJ4 3eGi4QsRCkT3pyGUVveYDpQ/mrqlXgbnCFFn5eEyX7GU5WQPci5i6Y3wMaU3nzBaz8qu lIKNtjS5m3AHqNQsUV+FqkYcQnhhVzsj5/zmkjKmKfp/4FJW+AA1EB76ie58OC0SpnuH 1spA==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=XYv2raMl; spf=pass (google.com: domain of fm-51332-20260331081020835221066b00020700-fvrxim@rts-flowmailer.siemens.com designates 185.136.65.225 as permitted sender) smtp.mailfrom=fm-51332-20260331081020835221066b00020700-fVRXIm@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20251104; t=1774944623; x=1775549423; darn=isar-build.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:feedback-id :mime-version:references:in-reply-to:message-id:date:subject:to:from :from:to:cc:subject:date:message-id:reply-to; bh=iD9YG11neghaW/wMBoRsmBqTDjmzV2Ln0UDRO4nT6vw=; b=aTQGk4NaQe2TXfB00UQzTjsl8H8+ef0IZhZ5pLUrLpMEiqw9afSlEuat3uCrz69xOf 6BFysPZKMPG4TLbA3SVtSHrdK6mXmSh5R1skwRco1Y40GSyH+BdzsMXS2DAUfNG1iET1 dMBTcanL68JxJ+KqlFABizWdmeKkBv8SiyK1JpThmoWAYq5Xa+SGx4OGvdlUjkBO+uP8 ELH7YKuDU4bGoNawgfOcIW43NTYXVVOYV3kxNjmgrEVOGne2qs6+VQ95l9E4LpcMlAPo tPSe5J/fER5CRxlbFPCXUtwxMirhQjMQvjzifXZYIhMcuI7VYqzG3ELl1jdl8ymbZQkI cAvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774944623; x=1775549423; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:feedback-id :mime-version:references:in-reply-to:message-id:date:subject:to:from :x-beenthere:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=iD9YG11neghaW/wMBoRsmBqTDjmzV2Ln0UDRO4nT6vw=; b=Tr7711eep8PgCxxQUc+zZjRJgGX7wEe0kTrsiINQ5yy0Nd4IIfwWaY4VHsEH+wFhPD qkbJe24dQylezSI44ViCE7UVNQITLA5sRN39YSzMcKIigc/koYP+5mfMRIXWDoc4zHVN XSKP12zXVJMMt41/y1DwErUCs0dpY4eD9M7Sy8k+DrJSuktcS84lfe4GTe7PROqN8gkk iCk+BC5GbrwTB7SdEYujpBaLvWpAQs2c6FTe+1kwHlOVe2kzycwKQaC21upFfwK29Pcn Yi3mRT7plqi3Ls/5x5oJMqbfLBU6CQzVI5hMx0pj5N6WZ6/HvcrTPZ8TQoe/diIZL96T 2eNw== X-Forwarded-Encrypted: i=2; AJvYcCUBhBhytt6pJx8nKJ/GfDEecbTtOAizcAwLfB1siU1TLmEpYfEvxoyZ9bwcW2ExcVewmAhf9ow=@isar-build.org X-Gm-Message-State: AOJu0YxnLYBtJmsA52JI+2x9i+pd+rvHsi1nDH7jiAmaPefxphOjhqNF kh7+kxskg38W3gRR/lOJd1ZQ9+fjJL82xZ+Ex71f6aCDonUteg8Cn+2B X-Received: by 2002:a05:6214:1bcd:b0:89c:618b:582c with SMTP id 6a1803df08f44-89ce8d3a3e1mr225853616d6.16.1774944623418; Tue, 31 Mar 2026 01:10:23 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com; h="AYAyTiLcmb6pRsAWMpgwJT0BY5yWn349z/zstalLCheVtRbsNA==" Received: by 2002:ad4:5cca:0:b0:89a:1a93:3389 with SMTP id 6a1803df08f44-89cd80cb955ls144098746d6.2.-pod-prod-06-us; Tue, 31 Mar 2026 01:10:22 -0700 (PDT) X-Received: by 2002:a05:620a:448b:b0:8c9:fb69:e708 with SMTP id af79cd13be357-8d01c60d494mr1935884485a.25.1774944622539; Tue, 31 Mar 2026 01:10:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774944622; cv=none; d=google.com; s=arc-20240605; b=K8aLdY/tIBo8SvPjG4g43bOOlFGsc2XNviAZlGXzS9iHRxCnAmW+KuaOA//PbW1DsA BjssSRNk9jHY5tQey2Mb6dc9V659irxGPeKGNSdGCc1NnduQEArXWE5BvoDOvzpCv11y +xF0Nvy7dPlLQhdX4ZAal9lw7PxiaA00UwMR9HAp93PSsrfrPeqUptFiRdN/yDdrm3Sx /+3NiQgVDUUQ5W5WFl4H84OHm4x21odnLNvPTlzwmC2Zr2hn1+r83+uxNKmrAbZF2D3C 0yvaYSD80EV6gpekRbeLPJsU0bmDAhwb3KhSEZy5qfLOzJZ2GLQDSB9S7cQwXE7PrL7L inbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=feedback-id:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:to:from:dkim-signature; bh=pOR+GKf+K3N/ERQy1HrX1vepcWFz7hM2K1M8dpquE0c=; fh=7tclEdh7YbwSQowgJ6LNq720O7H5HTEaqj22NJWRE2E=; b=Uq+0Jl5KqEETz0QQ2edqHg1vNlDDBZZ6olvcCdJPaFJ0x8MLTzs3qL/yBS9cRs3cBl 1/18wyJZYczD224OKVTGtCsYJV8AL8mcMqKr19IQzZeIi8QMq0FxgQbKaBXS018kN+9Y 169WTWrCRttGRoMrVblY/PBI4bA5T9rGurg+81pXrvPUBZg4pBmMR9DGFUxf/u/lDYUi OrmiKrVlNVT6kSDeJjRGEWZdOL/t/2hxYMRh2pYoLvTptuCu40/xOhifHcwT/SYF44eu 3MKGfxQrjdd8chrBrRiHAwckyQr48jlaolLbjyjfERJDIiLhlN4IR7avEGhNH8GKbZ0C DNBg==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=XYv2raMl; spf=pass (google.com: domain of fm-51332-20260331081020835221066b00020700-fvrxim@rts-flowmailer.siemens.com designates 185.136.65.225 as permitted sender) smtp.mailfrom=fm-51332-20260331081020835221066b00020700-fVRXIm@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from mta-65-225.siemens.flowmailer.net (mta-65-225.siemens.flowmailer.net. [185.136.65.225]) by gmr-mx.google.com with ESMTPS id af79cd13be357-8d027f28d3bsi30058885a.2.2026.03.31.01.10.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 Mar 2026 01:10:22 -0700 (PDT) Received-SPF: pass (google.com: domain of fm-51332-20260331081020835221066b00020700-fvrxim@rts-flowmailer.siemens.com designates 185.136.65.225 as permitted sender) client-ip=185.136.65.225; Received: by mta-65-225.siemens.flowmailer.net with ESMTPSA id 20260331081020835221066b00020700 for ; Tue, 31 Mar 2026 10:10:20 +0200 X-Patchwork-Original-From: "'Quirin Gylstorff' via isar-users" From: Quirin Gylstorff To: isar-users@googlegroups.com Subject: [PATCH v2 3/3] user_manual: add rust section Date: Tue, 31 Mar 2026 10:10:06 +0200 Message-ID: <20260331081019.32111-4-Quirin.Gylstorff@siemens.com> In-Reply-To: <20260331081019.32111-1-Quirin.Gylstorff@siemens.com> References: <20260331081019.32111-1-Quirin.Gylstorff@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-51332:519-21489:flowmailer X-Original-Sender: quirin.gylstorff@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=XYv2raMl; spf=pass (google.com: domain of fm-51332-20260331081020835221066b00020700-fvrxim@rts-flowmailer.siemens.com designates 185.136.65.225 as permitted sender) smtp.mailfrom=fm-51332-20260331081020835221066b00020700-fVRXIm@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com X-Original-From: Quirin Gylstorff Reply-To: Quirin Gylstorff Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-Spam-Status: No, score=-4.9 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,RCVD_IN_RP_CERTIFIED, RCVD_IN_RP_RNBL,RCVD_IN_RP_SAFE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= From: Quirin Gylstorff Signed-off-by: Quirin Gylstorff --- doc/user_manual.md | 68 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/doc/user_manual.md b/doc/user_manual.md index 7520854b..79580702 100644 --- a/doc/user_manual.md +++ b/doc/user_manual.md @@ -20,6 +20,7 @@ Copyright (C) 2016-2019, ilbers GmbH - [Customize and configure image](#customize-and-configure-image) - [Create a Custom Image Recipe](#create-a-custom-image-recipe) - [Add a Custom Application](#add-a-custom-application) + - [Rust in Isar Builds](#rust-in-isar-builds) - [Build statistics collection](#build-statistics-collection) - [Isar Cross-compilation](#isar-cross-compilation) - [Examining and debugging package generation inside their schroot rootfs](#examining-and-debugging-package-generation-inside-their-schroot-rootfs) @@ -1039,6 +1040,73 @@ be installed via `IMAGE_INSTALL`. Have a look at `prebuilt-deb`. --- +## Rust in Isar Builds + +This is a collection of recipes and links on how to +package rust crates. + +This document takes most of its input from https://rust-team.pages.debian.net/book +which contains the practices of the Debian rust team. + +### Crates on crates.io + +We provide a generator in `scripts/generate_cargo_crate.sh` which +generates the scaffold for these crates. This follows more or less +the approach of Debian with https://salsa.debian.org/rust-team/debcargo-conf. + +The user steps necessary are the following: + +1. Generate the package by calling: +`scripts/generate_cargo_crate.sh [CRATE_VERSION]`. + +2. Patch to build with the current Debian release, e.g. relax the dependencies +in `Cargo.toml` + + +### Crates not on crates.io + +There is currently no generator and it is recommended to follow the traditional +packaging approach, see also https://rust-team.pages.debian.net/book/process-workspace.html#general-setup. + +A working rules file could look like this: +``` +#!/usr/bin/make -f + +export DEB_BUILD_MAINT_OPTIONS = hardening=+all +DPKG_EXPORT_BUILDFLAGS = 1 +include /usr/share/dpkg/default.mk +include /usr/share/rustc/architecture.mk +export DEB_HOST_RUST_TYPE +export PATH:=/usr/share/cargo/bin:$(PATH) +export CARGO=/usr/share/cargo/bin/cargo +export CARGO_HOME=$(CURDIR)/debian/cargo_home +export CARGO_REGISTRY=$(CURDIR)/debian/cargo_registry +export DEB_CARGO_CRATE=$(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM) + +%: + dh $@ --buildsystem=cargo + +execute_after_dh_auto_clean: + $(CARGO) clean + rm -rf $(CARGO_HOME) + rm -rf $(CARGO_REGISTRY) + rm -f debian/cargo-checksum.json + +execute_before_dh_auto_configure: + $(CARGO) prepare-debian $(CARGO_REGISTRY) --link-from-system + rm -f Cargo.lock + touch debian/cargo-checksum.json + +``` +This example works for a cargo application and cannot be reused by other components +as the file `debian/cargo-checksum.json` is empty. + +An example for the initial cargo crate can be found at `meta-isar/recipes-app/rust-hello-isar/`. + +Check which packages are already part of Debian by using the tool `cargo-debstatus`. + +--- + ## Build statistics collection While isar is building the system, build statistics is collected in