From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id YPk7FUcoMGVxwwAA9RJhRA:P1 (envelope-from ) for ; Wed, 18 Oct 2023 20:47:35 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id YPk7FUcoMGVxwwAA9RJhRA (envelope-from ) for ; Wed, 18 Oct 2023 20:47:35 +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 1AF3B6C16A for ; Wed, 18 Oct 2023 20:47:35 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=GgqApMMv; 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=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1697654855; 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=NV/Kpv6khXxtbfU9hreIfxdJ/gZFikcv6u98tXl8nj0=; b=fmo0XYmiRLx2LVgdb5JdHaeHL88hjF+2WS/nqtbmpkOE2q+Ugq35b4+skXDmRiuosR+AgW sVBws76njdVfyKedC2Yg5fCdp1knqZ1p10JkgfuwCGuWmMxV7YvOLf+2udoFHIRG/R2x1G hosyuA7tmMLCGjsZxXJEcSYwk1YIy/T0CL1dhKH2WfDQBfZqi3Ey2i2QaSxNTjycy6H69G kUn1QrGv4nEle4xovQgocUEOK2Ztv2LibQSudCXsxomszTM3fVLdACRW53lMVfWqw5XEnV hA9QX4fA1r9eHonZEPTPZ4KWMP8xm+Zlq8n1KTayqv1WzPgkPm2GDnp1ZIqFWw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1697654855; a=rsa-sha256; cv=none; b=dPqZWqSmRNSeSgixzCImZtUwC+QL4wxxsKHnDwQXJyh2EzKV0aslJ50mfKsiv6jtwkj7Gn 1hrIFyRAa2AymxuTPR34KH4U0rrxHBKHh+hSiLHcmR2OhUQsREeA6Km5fHEZz1oOvrjcZp l7UUoPOmx139XpfAQsgR48JmtgqLGfwD72lshy/wR8MU8YGk7FAtXvNOHxAQoneeLf3dHg eyMCzd6jKqZz5eqXaEUynmMk5CQ/qIoUWwQkPwWZ4RhwuLzbYw8MsM4YRizalIM9RW5TIj sHfeNi1YkVMu/BqmeqJufw/+e4BdXjXGRhpdumtccpBBoAZDW9gRmSI07poavA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=GgqApMMv; 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=none) header.from=gmail.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtBZU-0003Mb-DT; Wed, 18 Oct 2023 14:47:08 -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 1qtBZP-0003MH-PN for guix-devel@gnu.org; Wed, 18 Oct 2023 14:47:04 -0400 Received: from mail-qt1-x834.google.com ([2607:f8b0:4864:20::834]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtBZN-0006PD-Rq; Wed, 18 Oct 2023 14:47:03 -0400 Received: by mail-qt1-x834.google.com with SMTP id d75a77b69052e-41c157bbd30so11060561cf.0; Wed, 18 Oct 2023 11:47:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697654819; x=1698259619; darn=gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=NV/Kpv6khXxtbfU9hreIfxdJ/gZFikcv6u98tXl8nj0=; b=GgqApMMvTHTDXaqRfeks2m/MrXQdNUElaX2eySjc2vI+uqVQApsVLTMwyag2HEetZp kxHayXuLCEjThvOgA6mz4axQ4a+7DsffcQ9GdNLJRDJwd798Us0ip92w59NIs0CEkNQj wotSt+5z4n+7xUm1WknZhq5go4N9Z9tKe7POVGjOe4hIRm7S8GjyCUAfYVwjSQvX5jxM axpeVtVPUZ/Pkq45HAjzan7FTfLEMjigCNPOSgu4qVXEcLmi8pFfQmmYGowEGf3GCU/x 6lGF1yEF6ZAg3eUFyf3/jidlHY9FSbw7C8gEsU9Uay2UN+uqaT2JW9ZeI3SrqyOt+FLB cw/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697654819; x=1698259619; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=NV/Kpv6khXxtbfU9hreIfxdJ/gZFikcv6u98tXl8nj0=; b=DlQTHT9kEugNhi4i7OZKa5r213DEjb5CWwiSppqeZGey5T82WO1fzFPBe92e9nWhJA GEoIKFiguYBaEdLGyLScRQAESWJl8Y+YoM3orYPrHnHb6J1vLgX2/n9fh3n7Xy/bQf7B UhnIY43pOOTA2vhSdIDI2z+XUr0Sj0RK0CmrTjczJHtJk6ovxIUUYPSy70vUzQB0LGAY CSEJjMADriMTtXGequoq5cYkIvtpAPiF51lT8zODwXbTLH/l0onQKBNn4PjnACi51Pn8 ZhDsuCGwECZJM3CG9ISn3GBJCCD7XyGGUb0MZ4jtoyqdI2DPsICTu+HebPl6piXzIAlN q8lg== X-Gm-Message-State: AOJu0YwudPjfi5Qdz5l+qsdXwvf/aRgy4dcn9Pt26Sp2H0pCd/zJav2D OvK8ygx2XXtKz424YYa7gTbJiK8kVXo= X-Google-Smtp-Source: AGHT+IHiEvhMFJOEBwoGh6Nl9lPT+jK8EnEx6FrgEYAdFX4GXjC1h32goqhVuK/eqzS0J+IjEmupow== X-Received: by 2002:a05:622a:149:b0:412:61e8:652 with SMTP id v9-20020a05622a014900b0041261e80652mr162621qtw.15.1697654819247; Wed, 18 Oct 2023 11:46:59 -0700 (PDT) Received: from hurd (dsl-155-177.b2b2c.ca. [66.158.155.177]) by smtp.gmail.com with ESMTPSA id i13-20020ac8764d000000b00419714dd0b9sm151580qtr.62.2023.10.18.11.46.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 11:46:58 -0700 (PDT) From: Maxim Cournoyer To: guix-devel@gnu.org Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [RFC]: Skipping rust crate tests by default In-Reply-To: (Efraim Flashner's message of "Wed, 18 Oct 2023 11:36:48 +0300") References: Date: Wed, 18 Oct 2023 14:46:57 -0400 Message-ID: <87sf67sr8e.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::834; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qt1-x834.google.com 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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-Flow: FLOW_IN X-Migadu-Country: US X-Spam-Score: -9.46 X-Migadu-Queue-Id: 1AF3B6C16A X-Migadu-Scanner: mx0.migadu.com X-Migadu-Spam-Score: -9.46 X-TUID: nHngtXjZ5csc Hi Efraim, Efraim Flashner writes: [...] >> 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). I understand that maintaining the large fleet of cargo crates packaged in Guix is a lot of work, but I think we can try some things before #:tests? #f; I gathered some idea below. > 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. OK. > 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. I believe that's the more useful comparison for our discussion; I gather that even -dev crates are built and have their test suite run when submitted, but since source packages are not rebuilt (they are a static archive, right?) then there's no checking that the test suite continues working in time. > > 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] += 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] += self[u_i] * kernel[(i - u_i)]; > 45 + conv[i] += 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] += self[u] * kernel[(i - u)]; > | ^ ^ > | > help: remove these parentheses > | > 49 - conv[i] += self[u] * kernel[(i - u)]; > 49 + conv[i] += 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. OK. Asking in ##rust on libera chat (unofficial channel), I got as suggestion to call 'carge test' with the '--cap-lints=allow' option documented here [0], which should effectively disable just the lint checks, which is better than disabling the full test suite. [0] https://doc.rust-lang.org/rustc/lints/levels.html >> 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. That means tests are disabled only when cross-compiling, right? Do we support cross-compiling rust crates? -- Thanks, Maxim