From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 4HDzKT9s8F/nIAAA0tVLHw (envelope-from ) for ; Sat, 02 Jan 2021 12:51:11 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id yNe8JT9s8F8/IgAAB5/wlQ (envelope-from ) for ; Sat, 02 Jan 2021 12:51:11 +0000 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 62E22940149 for ; Sat, 2 Jan 2021 12:51:11 +0000 (UTC) Received: from localhost ([::1]:45556 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kvgNC-00077A-A9 for larch@yhetil.org; Sat, 02 Jan 2021 07:51:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49086) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kvgN2-000771-Tu for guix-devel@gnu.org; Sat, 02 Jan 2021 07:51:00 -0500 Received: from mail-out.m-online.net ([212.18.0.9]:32793) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kvgN0-0008Hm-Hh for guix-devel@gnu.org; Sat, 02 Jan 2021 07:51:00 -0500 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4D7MFW5Flvz1qs42; Sat, 2 Jan 2021 13:50:55 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4D7MFW3zgXz1qs5S; Sat, 2 Jan 2021 13:50:55 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id Z7jLAp06zusg; Sat, 2 Jan 2021 13:50:53 +0100 (CET) Received: from hermia.goebel-consult.de (ppp-188-174-51-199.dynamic.mnet-online.de [188.174.51.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS; Sat, 2 Jan 2021 13:50:53 +0100 (CET) Received: from thisbe.goebel-consult.de (hermia.goebel-consult.de [192.168.110.7]) by hermia.goebel-consult.de (Postfix) with ESMTP id 54C65602D8; Sat, 2 Jan 2021 13:55:45 +0100 (CET) Subject: Re: Discussion: How to package rust crates now and in future? To: Pjotr Prins References: <87tuskmq7l.fsf@nicolasgoaziou.fr> <995a1d66-1c65-15fd-ea61-669e2160bc71@crazy-compilers.com> <20201219064232.4ioar4776lxh6wm6@thebird.nl> From: Hartmut Goebel Organization: crazy-compilers.com Message-ID: <152549d0-cfb4-79e8-98c5-671a35f90c30@crazy-compilers.com> Date: Sat, 2 Jan 2021 13:50:51 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20201219064232.4ioar4776lxh6wm6@thebird.nl> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US Received-SPF: none client-ip=212.18.0.9; envelope-from=h.goebel@crazy-compilers.com; helo=mail-out.m-online.net X-Spam_score_int: -36 X-Spam_score: -3.7 X-Spam_bar: --- X-Spam_report: (-3.7 / 5.0 requ) BAYES_00=-1.9, NICE_REPLY_A=-1.118, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel , Nicolas Goaziou Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -1.33 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: 62E22940149 X-Spam-Score: -1.33 X-Migadu-Scanner: scn1.migadu.com X-TUID: wRBwZhqID3ka Hi Pjotr, Am 19.12.20 um 07:42 schrieb Pjotr Prins: > They are talking about librification of the language > https://rust-lang.github.io/compiler-team/minutes/design-meeting/2020-03-12-shared-library-for-types/ > which may lead to a wider idea of libraries. For your needs static libraries would suffice. Anyway: Unfortunately this feature did not make i to the 2021 roadmap, AFAICS. I'd be happy enable building crates when rust has some notion of library. Until then I strongly propose to not build intermediate creates per default. > The language may still be changing - but I think it has gotten to the > point that they can't change too much without hurting large software > projects. It probably is a bad idea to mix different compilers to > build crates in one software stack. Maybe I am misreading your idea, > but we either have a 1.40 build or a 1.46 build. Unfortunately this is not just an idea, but a sad reality :-( As of today, the rust used by cargo-build-system is still 1.45, while some crates (e.g. sequoia) require 1.46 language features. So in fact we already/currently have a mixed stack. Maybe this is just since nobody did update default rust to rust 1.46?! Anyhow, my argument about rebuilding without any use still holds: When upgrading rust, all crates will be be rebuild (which is part of guix's concept) and the results are thrown away right away - which is a wast of time and electrical power. >> 6) This not only effect berlin, but also every user out there requiring >> a rebuild for some reason. This will lead to a very, very bad user >> experience - practically kicking out users with less powerful >> equipment. > The Rust user experience is that Rust builds all crates or installs a > single (static) binary. Even for Guix developers, the default is to > use cargo because of the insane number of dependencies it typically > pulls in. We package dependencies when we want to deploy, not to > develop. I assume you are referring "Rust user" to someone using rust for developing some rust software? I'm referring "user" to someone using Guix for managing their system. > The user here is a guix user, of course. So between compiler versions > we rebuild the stack and then distribute binaries. No rebuilds get > triggered normally. I think the use case you are referring to is users > as developers (right?) who are actually used to waiting for cargo. I > wait for cargo when I start a new Guix development environment. FMPOV there is not much difference between a user and a developer here: If substitutes are not available, a user - and this includes developers - needs to build the packages. And even as a developer I don't want to build the whole stack myself, but use substitutes - like I want to use pre-built libraries for other languages. My point is another one: While for programming languages supporting (static) libraries the number of compiles is O(n), for rust – assuming #:skip-build #f – it is O(n*(num_average_dependencies+1)) - since each crate needs to compile all of its dependencies, even if 20 other creates did this already. To give you some numbers: sequoia 0.20.0, while directly depending on only 55 crates, pulls in more then 430 crates (in words: four hundred and thirty) and compiles about 280 (in words: two hundred and eighty), including some duplicates compiles. Assuming each package depends on one other crate (which is a low assumption), this will be 2*n=860 compiles. Assuming each compile takes 30 seconds, and half of the packages need rebuild, this is more the 3,5 hours - right away into the trashcan. -- Regards Hartmut Goebel | Hartmut Goebel | h.goebel@crazy-compilers.com | | www.crazy-compilers.com | compilers which you thought are impossible |