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 ms13.migadu.com with LMTPS id 2PbEFtDeXmeySAAAe85BDQ:P1 (envelope-from ) for ; Sun, 15 Dec 2024 13:51:12 +0000 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 2PbEFtDeXmeySAAAe85BDQ (envelope-from ) for ; Sun, 15 Dec 2024 14:51:12 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=N7zvxfnB; 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=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1734270671; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=pZ0at688mTux2QyY2Q4UIcd3AP1LnIjQyvkVCWknzso=; b=KEe0yhPriIXlqY7naRmnX3uV3s47DTNZ4Mf1wV6Rn+xGK7OmZXPH19p7U2NaobnBP112S3 vusJcXtXTk8F7Q1k339DTgBT0KJeE5b1q20RxCnad/4uHGo/eY3ojM6U+jxzmqWJJt/sqk raBlnKMaxnlfG9aFAAJN7zbaWqucUEOoEOP5Z9uaNtv3Z1cRS4NhCJxns4wJ8Ae1Eq1H02 jeDplz3b7PUndTtAweaOxBEdIcQ/TlK2ljontrlFlUaAf1mvrK8G+W+2Of8zX+z3TS9ffm gkIf0sKIy7bEDOwRyZT5kGRlGEELFqKOB8TXnu7oC222+utm2zY1HwVZCriWJw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=N7zvxfnB; 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=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1734270671; a=rsa-sha256; cv=none; b=YmnEh7P5ukVSvga/+iARpZkUgaJhENnRFdKsablC5MmF59pEIqlzEx7U7toYPjCOVg0eBY W+b0szRGu6URD6/W5NaaoTzQApUCTusvCXbdfsVb1fKOs78B6T5t+l7zsS+GRQq+hm14UI cl33+N/xsIqLTLJpnbXkCZWzQ0VIcFed/IuxixigN6Tv78W7r0eM8aYZt7d7qC3SlIQWFF ngJxriUCLM5RyqI1MoogjSQD0MAULq53uwYp5mPPUMfZGhxzwvnGzvkorAEVPcreNuxtz/ lkbMUxIRWFyy6kRlQLDTT4LB0HZCd6XlTEtT7rx7IQPZ843SgmM+DIJ0E3tMFQ== 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 D5F894C56 for ; Sun, 15 Dec 2024 14:51:11 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tMp0z-00025M-0J; Sun, 15 Dec 2024 08:50:33 -0500 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 1tMp0v-00024u-NR for guix-devel@gnu.org; Sun, 15 Dec 2024 08:50:30 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tMp0t-0000vx-R2 for guix-devel@gnu.org; Sun, 15 Dec 2024 08:50:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=pZ0at688mTux2QyY2Q4UIcd3AP1LnIjQyvkVCWknzso=; b=N7zvxfnB6VuQAyFOcZBg 5/CP8yhdaV4C8VpmYWqgMptVpftRBWPKtpJ3b594e70rfIP+kxiKKvGUklv1PrFxPpd6l7jb/oDo+ DAa69177LBx2m9SUFlI0bFL/gCnS1aQeQa0AUwexJUdsCYaH80x3qR8RZiCEjNiZmlHjQ8eEbTpxs +Wx828N86zq/vXlsrLCG5OupnolS011QBS/JWv+zMh5ZHIuKV80gqu+1Sab1DxMfWXe1ifMLWyg4F F4sKdgd7nNi8T0FaoSO/J4ysfJew548ti2ni7M80j+/M8dEWJ0wJa1E5Tj3sP8iwSQ7ATjqVe8B3i WR2VFZR4hrPArA==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: guix-devel@gnu.org Subject: Re: Use and abuse of =?utf-8?Q?=E2=80=98computed-origin-method?= =?utf-8?Q?=E2=80=99=3A?= the =?utf-8?B?4oCYcnVzdC1yaW5n4oCZ?= case In-Reply-To: (Efraim Flashner's message of "Sun, 15 Dec 2024 10:41:07 +0200") References: <87cyhtlwla.fsf@inria.fr> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Quintidi 25 Frimaire an 233 de la =?utf-8?Q?R=C3=A9v?= =?utf-8?Q?olution=2C?= jour du Grillon X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Sun, 15 Dec 2024 14:50:22 +0100 Message-ID: <87ttb5hx7l.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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-Queue-Id: D5F894C56 X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -6.77 X-Spam-Score: -6.77 X-TUID: PWZXrteMj6/h Hi! Efraim Flashner skribis: >> Anyway, the =E2=80=98computed-origin-method=E2=80=99 hack prevents input= rewriting from >> working as expected because the inputs of that big gexp aren=E2=80=99t v= isible >> by just traversing the package graph. That=E2=80=99s a problem. > > Are we talking about the inputs used for the computed-origin? (perl, > nasm, go, etc?) Yes. > I'm pretty sure there are 3 options here: > 1. Stop rebuilding the generated files. This is what we did in the past, > and it allows rust-ring-0.14 to be used on riscv64-linux. I haven't > talked with the Debian folks about it but I'm pretty sure this is what > they currently do. I don't like it because we have instructions on how > to do the rebuild and it's already implemented. I also really like that > everything can be regenerated from (nearly) any architecture, which > makes it a much nicer build than qemu, which needs many cross compilers. Yeah, we=E2=80=99d rather build from source. > 2. Use the trivial-build-system instead of a computed-origin-method. > I'm pretty sure we can use the output of the trivial-build-system (or > any other package build) as the source for another package. I > currently think this is the best option. Yes, that should work. > 3. Adjust the build.rs file in rust-ring to call a custom shell script > which will build all the missing files that we would remove in a > snippet. This is probably best from a "the source is ready to hack on" > perspective, but it means we're carrying around a custom build script > with no chance of being upstreamed. It also means that each package > which uses rust-ring will need to have all the rust-ring build > dependencies added and it will need to be built each time. > > I've attached a patch that I tested locally to build the sources in an > actual package, and then use that to build rust-ring. I tested it by > building librsvg. Currently it still requires go itself as using gccgo > needs gccgo-toolchain. Nice! > + (package > + (name "rust-ring") > + (version "0.17.8.tar.gz") ; Hack to adjust the output name. > + (source (origin > (method git-fetch) > (uri (git-reference > (url "https://github.com/briansmith/ring") > @@ -4147,182 +4148,185 @@ (define rust-ring-0.17-sources > (file-name (git-file-name "rust-ring" version)) > (sha256 > (base32 "0rqfal81bf4l3dja98cajfjq2jbz1rcx7xdp2r33cxrm5y5ps= r28")) [...] > + (build-system trivial-build-system) > + (arguments > + (list > + #:modules '((guix build utils)) > + #:builder > + #~(begin > + (use-modules (guix build utils)) > + (setenv "PATH" > + (string-join > + (list (assoc-ref %build-inputs "clang") ; for cl= ang-format > + (assoc-ref %build-inputs "go") > + (assoc-ref %build-inputs "gzip") > + (assoc-ref %build-inputs "nasm") > + (assoc-ref %build-inputs "perl") > + (assoc-ref %build-inputs "python-minimal") > + (assoc-ref %build-inputs "tar")) You could use #+(this-package-native-input "clang"), etc. If it works, I=E2=80=99m all for it! I wonder if another option would be to make a proper package, which would install the generated headers to $output/include and the generated .o files to #$output/lib. That package could be among the =E2=80=98propagated-inputs=E2=80=99 of =E2=80=98rust-ring=E2=80=99. Dunno = if that would work though. Thanks for the quick reply & fix! Ludo=E2=80=99.