From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id kJd+Nl+ZL2X6TQEAG6o9tA:P1 (envelope-from ) for ; Wed, 18 Oct 2023 10:37:52 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id kJd+Nl+ZL2X6TQEAG6o9tA (envelope-from ) for ; Wed, 18 Oct 2023 10:37:51 +0200 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 81CCF43205 for ; Wed, 18 Oct 2023 10:37:51 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=KHeKWHbm; dmarc=none; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1697618271; a=rsa-sha256; cv=none; b=ugWmMZ7TWBRM/7yu4MPBSmObtCHxpmhYcOy1RGiWDgEF8nHPcOu8MIT1NI85lQ331tLVjR OMWPusa1kPC5p/GmJJPqUtZnYDiatfQRQJ4/U1c1DDkX41JGppKElGhAaAYqw1A+KOEmr8 AxdzKdEMfUk7l5BUKjJxTUMWLTLDIcA8G5XY0qajYcgDMcCQ7zEV00NRb3VVDKQ2XDpf3+ 3WWeDCSzrlpIXVe2wR3pVQqTP8iSccqNsPal1fu/EAWPYUNbsO9MtazamPgnqBRJbJDWsE +FaB6TW4/a9IyUhC8OkjTg5gYkuwrVv9gT3+j0HFNUFY5HJ5ese3yYDNkjX8SQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=KHeKWHbm; dmarc=none; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1697618271; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=mj60wPfw6A/jOUFdktIr06Mpon3ddbGC0x022XGmqBU=; b=o3IiLGIdyKIlDDWvF28lDNbEFh1cutbSR0ti2ac41IvkknHvxJRypGAAs8CqILZqeT8dKc 9ZMMAiAlsQHwYmXYx7FbLagZVAoQkgIYsSvQo3uf4zf04QA1LGnPLsnErrlcmatpqWiMbk EWelwDtyK3mD+G+4GlsqNClf8m/cc9zIj9wMsc/ZCszIIlb9kuAZxHJPXLL1iv+yzWrfFw r0gOk/t4k5mcEFsnxvJCeTI5fh64qxD9ODbta+Ba1HLe3zg8O6LsuN6erTREYJaRMBuSxd R22b7ISxsVJKgNJF6PgDYwPtvOjeIY6UQ8GP0yU9JF0p3kj9L2lPxVCv/YLf1w== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qt23L-0001Er-Js; Wed, 18 Oct 2023 04:37:19 -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 1qt23J-0001E7-RB for guix-devel@gnu.org; Wed, 18 Oct 2023 04:37:17 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qt23H-00059T-IH; Wed, 18 Oct 2023 04:37:17 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-40651a72807so60062305e9.1; Wed, 18 Oct 2023 01:37:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697618233; x=1698223033; darn=gnu.org; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender:from:to :cc:subject:date:message-id:reply-to; bh=mj60wPfw6A/jOUFdktIr06Mpon3ddbGC0x022XGmqBU=; b=KHeKWHbmt7zhFafv5I+ApUXNtkuwnm66yPbMbrCLmXL8PkLysVf85KzkRRr/v+d8W1 nA/sDo+O+9dRPmYuRkF4dUxN6JEOEWnsSfxcOBxZZq2ZxtFGCMYMnpSq2b0CS+/OcfEk vY47OPASD6clGBQ6+PVOCnb/iTiir1dr7IoTWhI9rOYr4N81PriLgTrZ0DgYC85Vnu/O IZ8gd6uON025vV+FRyfuWY+w41mmONXp8trsdPcyXctayyRqG57qhZJnLEWYPy1G3aXo SjLYlxAieKdaX1lMh63AxAPBEtjM8+iuUs/YNgnjfhPL9vidlc6vkJwxHp+zkYQW+UWo ukeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697618233; x=1698223033; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=mj60wPfw6A/jOUFdktIr06Mpon3ddbGC0x022XGmqBU=; b=C6hMqfHOajqOnd2eoCjTkoXxVDESIT104bOHB3P7tY6fwCFjUBIhKQ9ncBKrOrTZS9 WK1GbelDesx5zF2nw6sLxlH0s4UcHuZPPTBfnEX+9EeQR1nKmm/3MRKs/m0cKBKr0m07 IKHfGf0XNioGzojRu/1Rv4AlGjyMXVLdyAXPGIk6kN4CZoKNIlzxAl20vGMSEuatkSAK 7thu1a0fKulqILA2+Dz6yhmkXUuQU/Mz7GgtVj5nKFbA2nSAI0gGimNH4pnBBHl4HdvL q7lozwiXmSHUqnZfgtCzSP1kAXqcvHaOQFCAkCfEWOLLOyYUeSb2A/hxUDGwO17Huvm3 daGA== X-Gm-Message-State: AOJu0YwnndLSvPCaHnsFDEYUs8iXgmaZY96zCWqq7EK/gN/x6Qk6bkFI Q/z96GYc7sTEf48gWk4Wd3L7Nc74ZCQJkg== X-Google-Smtp-Source: AGHT+IEK2GZbyQYw0mHFDQ6HHUuyfqr9AC5nR5cNlYUDFMgVTmaBIPCPMBSMuAFt9pFClCAgJ9ij2A== X-Received: by 2002:a05:600c:1f93:b0:3f9:b430:199b with SMTP id je19-20020a05600c1f9300b003f9b430199bmr3694489wmb.15.1697618233174; Wed, 18 Oct 2023 01:37:13 -0700 (PDT) Received: from localhost ([31.210.180.106]) by smtp.gmail.com with ESMTPSA id j20-20020a05600c1c1400b003fefb94ccc9sm909131wms.11.2023.10.18.01.37.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 01:37:12 -0700 (PDT) Date: Wed, 18 Oct 2023 11:36:48 +0300 From: Efraim Flashner To: guix-devel@gnu.org, Maxim Cournoyer Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [RFC]: Skipping rust crate tests by default Message-ID: Mail-Followup-To: guix-devel@gnu.org, Maxim Cournoyer , Ludovic =?utf-8?Q?Court=C3=A8s?= References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="zaGa7DrEjZ3lTJL2" Content-Disposition: inline In-Reply-To: X-PGP-Key-ID: 0x41AAE7DCCA3D8351 X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc X-PGP-Fingerprint: A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=efraim.flashner@gmail.com; helo=mail-wm1-x32d.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx1.migadu.com X-Migadu-Spam-Score: -0.77 X-Spam-Score: -0.77 X-Migadu-Queue-Id: 81CCF43205 X-TUID: BrumDZnsip7m --zaGa7DrEjZ3lTJL2 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 05, 2023 at 03:52:46PM +0300, Efraim Flashner wrote: > Currently for for rust crates we build the crates, run the tests, and > then in %output we only have the license files and a repackaged version > of the source. >=20 > The build system goes: > unpack source > unpack crates > patch shebangs > patch checksums of the crates > 'build > 'package > 'check > 'install >=20 > 'install is clear, it does whatever the install command is. >=20 > 'package repacks the source crate, after we've done any changes to it in > the snippet and later if we've gone and patched paths to binaries or > libraries. In theory this is useful with using these crates in a > GUIX_ENVIRONMENT >=20 > 'check runs the test suite, which fairly often seems to need some > massaging to skip the odd test which fails or to try to skip the doc > tests, which fail far too often. >=20 > 'build sounds like it just builds the package. The first thing it does > it makes sure that all the necessary crates are included in the build > environment. >=20 > IMO the 'build phase is the most important one, it's the one that lets > us know if all the cargo-inputs and cargo-development-inputs are > correct. We don't care if rust-rand-0.6 or rust-nb-connect-1 builds, we > only care that it has the correct inputs so that when we pull it in for > an actual binary or library everything builds correctly. >=20 > I propose changing the cargo-build-system to have '#:tests? #f' by > default and then enable them for packages which have a "clear output". > It will keep the benefits of knowing we have the correct inputs without > worrying about test errors we don't care about. If it fails to build > during its own 'build phase that's actually worth looking into. It will > also cut down the amount of time the CI spends building unneeded rust > crates, and lets us see which ones are actually broken. To add some more context from other places and to try to flesh out more: On Tue, Oct 17, 2023 at 11:41:11AM -0400, Maxim Cournoyer wrote: > Hi Efraim, >=20 > Efraim Flashner writes: >=20 > > IMO rust-team branch is ready to merge. We've updated rust to 1.70, > > librsvg to 2.56.4 and many new and updated packages. We've added a phase > > to the cargo-build-system to fail if it detects pre-built files and > > we've set the cargo-build-system to skip the test phase by default, > > allowing us to make sure that the packages have the correct inputs. With > > these changes I've gotten 100% of the packages built using the > > cargo-build-system to build successfully. >=20 > This sounds good except I don't understand how disabling the tests by > default help to "make sure that the packages have the correct inputs" ? When the tests are disabled, if a package shows red on the CI it means that either: A) there was a bundled shared/static library in the sources which need to be removed B) The inputs weren't correct and need to be fixed. What we're skipping is C) the test suite failed. When we get to the 'build phase of the cargo-build-system, cargo first checks that it has all of the crates listed in the Cargo.toml file, and that all of those crates have all of their (cargo-input) dependencies, and so on. If any of them are missing then the build will fail. This is also why we need to set #:skip-build? #t when we don't include the desired cargo-development-inputs. The change is mainly a quality of life improvement; it decreases the time that guix people and CI spend building these crates, and it makes it easier to see which, if any, rust packages need to be checked for brokenness (with the assumption that a broken or bit-rotted test suite isn't a problem). My premise is that the test suite of crates doesn't necessarily pass when built and run with a newer rust and that we shouldn't be concerned about it. > You've explained the rationale here: > , > saying we sometimes use a newer Rust than the package tests are > expecting; how does it work in the Rust world? Don't they always build > even older versions against the most recent compiler? What about the > test suites then? Are these not typically run by users/distributions? In general, since rust expects all of the crates to be in source form, the tests are only run by developers when the crate is being developed. If someone comes along and uses that crate as a dependency for their project then they don't run the tests. If they continue using that crate (at that version) for several years then the developer using that older crate as a dependency still only compiles the part of the crate they need for their project and they only run the tests for their project, not for the crates which they've used as dependencies. As far as distributions, I can talk for Debian that they only provide the crates as -dev packages, that is, as the source crates. They make sure that they compile (and probably that they pass the test suite) at the time that they are packaged, but no one is distributing pre-compiled crates as packages to be used as inputs for further packages. For an example of a failing doc-test, from the rust-nalgebra-0.21 crate: Doc-tests nalgebra error: unnecessary parentheses around index expression --> /tmp/guix-build-rust-nalgebra-0.21.1.drv-0/nalgebra-0.21.1/src/linalg= /convolution.rs:45:47 | 45 | conv[i] +=3D self[u_i] * kernel[(i - u_i)]; | ^ ^ | note: the lint level is defined here --> /tmp/guix-build-rust-nalgebra-0.21.1.drv-0/nalgebra-0.21.1/src/lib.rs= :78:9 | 78 | #![deny(unused_parens)] | ^^^^^^^^^^^^^ help: remove these parentheses | 45 - conv[i] +=3D self[u_i] * kernel[(i - u_i)]; 45 + conv[i] +=3D self[u_i] * kernel[i - u_i]; | error: unnecessary parentheses around index expression --> /tmp/guix-build-rust-nalgebra-0.21.1.drv-0/nalgebra-0.21.1/src/linalg= /convolution.rs:49:53 | 49 | conv[i] +=3D self[u] * kernel[(i - u)]; | ^ ^ | help: remove these parentheses | 49 - conv[i] +=3D self[u] * kernel[(i - u)]; 49 + conv[i] +=3D self[u] * kernel[i - u]; | error: aborting due to 2 previous errors error: doctest failed, to rerun pass `--doc` crates.io lists this version as being released more than 3 years ago and targeting the 2018 edition of rust. When built with our current rust-1.68.2 the doc test passes but not with 1.70.0. The current upstream version of nalgebra is 0.32.3, so it's unlikely that they'd release a new version with the doc tests fixed, but I haven't contacted them about it. > For one thing the 'guix lint' command would need to be told that > cargo-build-system has #:tests? set to #f by default to not warn without > reasons that '#:tests? #t' is unnecessary. Instead of #:tests? #t I used (not (%current-target-system)), but I hadn't tested it with guix lint to see if that would need to be changed. --=20 Efraim Flashner =D7=A8=D7=A0=D7=A9=D7=9C=D7=A4 = =D7=9D=D7=99=D7=A8=D7=A4=D7=90 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --zaGa7DrEjZ3lTJL2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmUvmSAACgkQQarn3Mo9 g1E+aA/6AmE9kcxGR/1jcUsevcZIeJa7CsOO0I1xk7rt+gi7zmwkv6bXN247imYl MBLg/j8VXzPeUz0WWAIb54/Mi2qGoWCCWsIR1JIPSX0RRlwk9moD9Njz97z4Wr4t pOdGDKNzwWficLZeE1wHshcDZLq4rohcqwUTLGFhKTjDhnAO+jiWqfcWrV/IrMHY 1pzWDS0AwyAbrN4ThoXoVrCbp8PJylE6LgFaRKN6krBqPge8jcXXrgvJBOEsNGZ7 rMIeeaU99dByE61ja7ZrHz9XaT3TUGHX/E0eBMq1duWFCkhxtks2KPag/S6swlUs /PJp3uQahLFnoMCyffEq3cqCw+f/9yWPWBtdzY42iuLedqPZRjFbt96xJLRLM18b GIVvoKE10WtyiD6x6y3HzL6oMKcqAOTz07nTYxtDHzX05+zKPaUbjFyU1anionlu ohr/v9mCtyQIw1Dy3skeNZUp5xVPZUHOL8qfVtmgoiUqV6WtfU+nB/KVlbNcADpi j+jRfMJ7ahBIT0QrZjgY5puDI2RZoqcFOqqTAJDo672JufK6+5NbbtCrbtqBCt1x vcjOUAlRqe3TI2aZK2iETKiC7UUTQ2w1pXAsLuCfRCe/ByGyFs/4qSPsxd39xE6N fbgbPYJnmxydsxxzqOeh95JUBOLrVtrDZYMsn0fCYH48OK2Pj7U= =0QWl -----END PGP SIGNATURE----- --zaGa7DrEjZ3lTJL2--