From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id GFX/FVrgTWYYswAAe85BDQ:P1 (envelope-from ) for ; Wed, 22 May 2024 14:08:58 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id GFX/FVrgTWYYswAAe85BDQ (envelope-from ) for ; Wed, 22 May 2024 14:08:58 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=disroot.org header.s=mail header.b=CEpUl0Ua; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=reject) header.from=disroot.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1716379738; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=bY38iMvGr96ciqpNyDbl0SU7gJA5sN0lJw1ixkVSbVY=; b=nB8HN9D+H+B7YakgRtzjfqR/Aer5m0DXMEhnCbhkRYxwB4mmHrM50iLFAKgMBge3OqdpOu lCIwAqXYdkk1KQiRXR6uOMTcSz3Vfk4b59LLoev1dahXTZMdXF6FW7h3/JpaxlMof1Z9ol DUioEA0UJo1kvqdKpLTIhACN9cJsl/uq/yzEzfXLsojLam+KHN2fLyzKFgQ2RY7M0VlKiN 9D4i/5i7Kq6r92u9dY90mTZYeT5dQd52lR3Gm6JpF6R047sM/LRQcp83v7M77jfbkNLAgw BuI4GSS7MmH1PIZWfSUNQFwk/0jIP4ULTBLjx7PCrb8TKmd7ZLLJYYenIAaYRQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=disroot.org header.s=mail header.b=CEpUl0Ua; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=reject) header.from=disroot.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1716379738; a=rsa-sha256; cv=none; b=K0ku1CRHVly3VuiNRC+sYE8q2ZNcFPNg6YiESVMYt/XVKYZkOVLmvVmJ6jFlqOgV2mjmWX RIzAgIbLmlvqKMhhITDmXgobqBLpINgyqNibgLsFQubXorMey6JQ3vdAwnBZiYL7dzk16x vTJzP0lGzWamrbyPlr7kbvcTtbW/+t8Au3gY9vzhVSHPoSKdpAvbvHt4EvC5p6FNLWiomz 9FDnVlaO5V4IzrQ/J056j+RHdyzt48f4T70//TFkDHssxEutqx9A6l0Cys3Ak1aAitohlm 6er/CFgpUvqTxYMS59cTNAqZOVM/dSi3WosH/BZEBQeU9x6S4r86lFjcuBNajw== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 1E63312E02 for ; Wed, 22 May 2024 14:08:58 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s9klZ-00034F-Mq; Wed, 22 May 2024 08:08:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s9bLb-0001uR-HU for guix-devel@gnu.org; Tue, 21 May 2024 22:04:55 -0400 Received: from layka.disroot.org ([178.21.23.139]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s9bLY-0003zk-JG for guix-devel@gnu.org; Tue, 21 May 2024 22:04:55 -0400 X-Virus-Scanned: SPAM Filter at disroot.org Mime-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1716343487; bh=bY38iMvGr96ciqpNyDbl0SU7gJA5sN0lJw1ixkVSbVY=; h=Date:Subject:From:To; b=CEpUl0Uaz98jNplOhgu/CXRH8qtshYahPyD2fK9Yw46k3iwYGHwS5lVHWl1NKUTfr oNscfVfaqTgBnUOgQB7xS0w9vyV10QRDDJbDyCCQBIQbOeD+4o4hjtb/KcSSBifNV4 o5859RBJ7x4VviH2gXc/6CZTmX8hfw45msflBicTO7njENK4+AOyUkJpy/974uK5Sn 0ZodhYXrw7JK48ED6sTVOkh2I0SOmVnAaX1R0gkle3H1RJL9gd76wweBvNZ2ldkYmp RhVgkIvaaHvqfK1bom2uIWWCujb4WWnU/yqtJxoyRobngAsjXYN/+f6XHQgJYYDEFD GDUM52ReQMNPg== Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 21 May 2024 23:04:44 -0300 Subject: Idea for packaging rust apps From: "Murilo" To: Message-Id: Received-SPF: pass client-ip=178.21.23.139; envelope-from=murilo@disroot.org; helo=layka.disroot.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Wed, 22 May 2024 08:08:15 -0400 X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -8.71 X-Spam-Score: -8.71 X-Migadu-Queue-Id: 1E63312E02 X-Migadu-Scanner: mx13.migadu.com X-TUID: kSSbJLLNjZ1n Hello, I hope this is the right place for this, apologies if it isn't.=20 I'm working with a friend on a cargo importer that lowers the entry barrier= =20 and the maintainability costs for packaging rust apps in general, without= =20 sacrificing Guix dependency tracking and reproducibility of rust packages.= =20 When you get used to the tool, you can pretty much package rust apps with= =20 all the dependency chain very easily (I just packaged [1] texlab for my=20 channel earlier this morning in less than 5 minutes, and i can easily=20 update apps to the latest version in less than a minute).=20 Progress is being tracked in [2] if anyone wants to check it out or=20 contribute to it. It is currently missing a lot of features, but we hope=20 to improve the user experience of the tool in the near future.=20 It is a very simple tool, it essentially parses the Cargo.lock file and=20 extracts all the relevant information for constructing the rust package=20 definitions of all the cargo-inputs and the package itself, and outputs=20 to stdio a guile module containing all the needed cargo-input chain as=20 guix packages, with all the cargo-inputs self-contained and versions all=20 sorted out for a working final package build.=20 This way a packager only needs to focus on the actual package they are=20 trying to build, instead of worrying about its cargo-inputs.=20 Due to how cargo-inputs are organized in gnu/packages/crates-*.scm, and=20 some current packaging guidelines for crates on Guix, we cannot simply=20 contribute these self-contained packages generated directly from the=20 Cargo.lock, thus requiring to use the guix crate importer and spending=20 a lot of time fixing dependencies and worrying about other packages=20 breaking in the process.=20 I would like to propose some discussion around a better way of organizing= =20 the rust packages and its cargo-inputs in (gnu packages) for building=20 rust apps that only need sources as cargo-inputs:=20 1) Create a new directory at gnu/packages/rust/ in which a contributor=20 can commit self-contained rust apps scm modules.=20 2.1) Add a new module at gnu/packages/rust/my-rust-app-1.scm=20 2.2) Add a new module at gnu/packages/rust/my-rust-app-2.scm=20 3) All package definitions inside gnu/packages/rust/*.scm which are=20 source-only (#:skip-build? #t) should not be exported.=20 4.1) gnu/packages/crates-*.scm will not cease to exist, existing rust=20 apps packages that have a Cargo.lock could gradually be migrated to the=20 new organization=20 4.2) libs which need to be built can still live in=20 gnu/packages/crates-*.scm=20 5) A (define-public my-rust-app-1 (@@ (gnu packages rust my-rust-app-1)=20 my-rust-app-1)) or equivalent could be done in a (gnu packages category)=20 module to export the rust app in the desired category.=20 6) Unlike nix (which also parses the Cargo.lock in the build system),=20 we don't lose the ability to make snippets for sources this way.=20 7) For updating/maintaining a rust package defined this way, one would=20 be able to simply re-run the guix tool, and replace the=20 gnu/packages/rust/my-rust-app.scm file, only copying over the final=20 relevant package definition for the rust app with its tweaks for building,= =20 and passing over the new cargo-inputs generated by the guix tool.=20 I believe that by only changing the way things are organized and having=20 a guix tool that generates self-contained package definitions from=20 Cargo.lock, it would be possible to greatly improve the time required=20 for contributing new rust apps packages and maintaining them on Guix.=20 Things don't need to be the way I described here, these are just my=20 initial thoughts after several failed attempts and wasted time trying=20 to contribute rust apps to Guix, I'd like to discuss workarounds and if=20 the benefits are greater than the disavantages for an approach like this.= =20 The tool we made works really well for packaging for our personal channels,= =20 I am very satisfied with how easy it is, and I think Guix could benefit a= =20 lot by adopting a similar approach.=20 What am I missing here? Are there any disavantages to this approach?=20 Anything that would break from it if adopted on Guix?=20 Any questions or suggestions?=20 Murilo=20 [1] https://codeberg.org/look/saayix/commit/c7643943545d62baba80cccee1650eb= f94362858=20 [2] https://git.sr.ht/~look/cargo2guix