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 ms0.migadu.com with LMTPS id 8CuyImyrZmEHwQAAgWs5BA (envelope-from ) for ; Wed, 13 Oct 2021 11:48:28 +0200 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 YCVSHmyrZmG3aQAAB5/wlQ (envelope-from ) for ; Wed, 13 Oct 2021 09:48:28 +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 D60907B8E for ; Wed, 13 Oct 2021 11:48:27 +0200 (CEST) Received: from localhost ([::1]:43190 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maas6-0006iW-Eg for larch@yhetil.org; Wed, 13 Oct 2021 05:48:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60820) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maai2-00063Z-OT for bug-guix@gnu.org; Wed, 13 Oct 2021 05:38:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46836) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maai2-0001Tc-Fh for bug-guix@gnu.org; Wed, 13 Oct 2021 05:38:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1maai2-0007KP-8o for bug-guix@gnu.org; Wed, 13 Oct 2021 05:38:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#50597: different fixed-output when using =?UTF-8?Q?=E2=80=99--with-source=E2=80=99?= transformation Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Wed, 13 Oct 2021 09:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50597 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 50597-submit@debbugs.gnu.org id=B50597.163411788028161 (code B ref 50597); Wed, 13 Oct 2021 09:38:02 +0000 Received: (at 50597) by debbugs.gnu.org; 13 Oct 2021 09:38:00 +0000 Received: from localhost ([127.0.0.1]:58382 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1maai0-0007K8-G1 for submit@debbugs.gnu.org; Wed, 13 Oct 2021 05:38:00 -0400 Received: from mail-wr1-f50.google.com ([209.85.221.50]:35381) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1maahx-0007Jv-Oq for 50597@debbugs.gnu.org; Wed, 13 Oct 2021 05:37:59 -0400 Received: by mail-wr1-f50.google.com with SMTP id g25so6233802wrb.2 for <50597@debbugs.gnu.org>; Wed, 13 Oct 2021 02:37:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding; bh=R/aAIFPNIchAmj1SNKKgmf6Zp/fa36nWqWyGBiIRQGw=; b=Tt2xS3BguSHF5jwuBIaJ81d/UbrbliK6YawvYUkxVg2467rEWg9Q70mnmYwrP8wi/M 6BoU/1JA/bc3mFbvQqx+JW/pYMK3lqpUNHZ3Ehr7EaVJudnNnXgwtga8FYoeCrhp0RV6 yr5F/CQfuqBYTmCffQs0pkEAAzheoWM3Ys2h9lKTugSFRdziKDcpEozonJWm9bp+xgy4 XMo8zkxOtjPe9OMJD1a5Kygyc/8Cf6qppkv1YCgx8vX8O8EMbEy4mx9o+I7+RzAPCXVj qbHnwq/7wjA8NNDzk5zZnJel4vLDj99c5zDKPWCNcn3ekMOfaHqeyUNwPuLIhNpYRodF q6dQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=R/aAIFPNIchAmj1SNKKgmf6Zp/fa36nWqWyGBiIRQGw=; b=wKjAdbVyU86ITiQylbb0HN4tRFcj27c0zLeF4EVfS1iwBY0HuPsQmvvK8Dh/3/B7bt N3Ekfi9gRHdxkIlle+nkJrqOh35onWftjT7yrwZ37+3lp1V4Uxm6gLrU8iW31HhtT2k1 qwggQqPI0RY9fFP0zZaNPieTXyYMvTPumfMIrti2ukiRUK7Lq6nECicUi6f3EP/ctOY0 A5sYgtwbzjO3S+ZOlsAnFJHiry1w2NdMjR5dwn838MVgCJgAISOGDBwJfJRYNjHM0bLK SO4cQqi2UqS5tqr/nQbdkcajhtrVeHCS5dpNmYu5XnyjQpuW88MORy6W0jaOynv49g/1 qASw== X-Gm-Message-State: AOAM530wunrUOjcEKe4JGgWP4kvFpfw9nISLpUt5tD795PTOqk5DgtIx silniB5dIwvmh+KGopsayJE= X-Google-Smtp-Source: ABdhPJzd6qIs+5RaP7NtGHV1OUwVwYla3pJLqc2haAbc9H5URxd4OgWNvynQ9M9Ocxyvnc/ktIOxSA== X-Received: by 2002:adf:a15c:: with SMTP id r28mr38862021wrr.287.1634117871783; Wed, 13 Oct 2021 02:37:51 -0700 (PDT) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id l6sm5214397wmg.10.2021.10.13.02.37.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 02:37:51 -0700 (PDT) From: zimoun In-Reply-To: <87bl4kj4af.fsf@gnu.org> References: <86zgsecrzv.fsf@gmail.com> <87fsu1uaup.fsf@gnu.org> <86czp2cr63.fsf@gmail.com> <87bl4kj4af.fsf@gnu.org> Date: Wed, 13 Oct 2021 11:31:37 +0200 Message-ID: <86wnmhi83q.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 50597@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1634118507; 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: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=R/aAIFPNIchAmj1SNKKgmf6Zp/fa36nWqWyGBiIRQGw=; b=EuM6cPcYmhCp8Z0+QZFOGugamedX5XCy5Z2nbHEeeNU6/3MqrWyN6Ppwlu8lZHcOMtJqp2 5fuYPStNT1iUhXNv8ligE8OXbtsyi7EDo8hHo3dodqIz654/AXqX9kyIuf2fLcUBYB4GkR J8tsmpKOL9e5wUCbZlv3nQj9W20u17FvnNNr8X2LJjSZrM70yPlBJ+JEv8jnO2MENmdjHc 1IzSPXFL25/mCrHUYdZpYPT8ZNOLYSGtpqKVPbhi3KgiZXxbT8U/oYAu/dKvaijYXNkkKv To/o519vJmX9gWYSmsh9QfyEG4kXuGNgIA3lgkfp/VLt+ZjaxpzADw9rFium1w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1634118507; a=rsa-sha256; cv=none; b=PPhpiJttNRB6NumyMiXpVw/N/oyR5PpFhzLP820p9oS0L35nn/JNMIgw2QM4fQ82Jdwv4r sfMJVBY/h3JuATEiloQK2lZyBpateM/WJ+0SWdEW/2M9yL3XkBnZUjfGa5kdyAGCtIz7EK fRRazZd1IV5c0E743zt5rsR9489LKnvShCnlIB4pcioA88SQ8EfUX1OK/wHF4XOurhCMak hYKGQ/hTTwm5f6ymxqmPJKHbug1RFjF7Houu9ZoTdFz2HV4rgUM8rZggvoT7xfKOClxzKl 4TyR1sfBlHGqIXoaxna170EjJQVTJOLoPUxOeIee/BghJ4Zxa5gPO+2iYGr2lg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=Tt2xS3Bg; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Spam-Score: -1.31 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=Tt2xS3Bg; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: D60907B8E X-Spam-Score: -1.31 X-Migadu-Scanner: scn0.migadu.com X-TUID: F3pwvKPaPtI1 Hi, On Wed, 22 Sep 2021 at 12:25, Ludovic Court=C3=A8s wrote: > However it=E2=80=99s not enough to get the same derivation: we=E2=80=99d = also need > to return a fixed-output derivation rather than a > plain store file name. (See also > .) Thanks for the explanations and the pointer. Indeed, to be continued=E2=80= =A6 > diff --git a/guix/transformations.scm b/guix/transformations.scm > index 5ae1977cb2..e0f5579c28 100644 > --- a/guix/transformations.scm > +++ b/guix/transformations.scm > @@ -46,6 +46,7 @@ > #:use-module (srfi srfi-37) > #:use-module (ice-9 match) > #:use-module (ice-9 vlist) > + #:autoload (web uri) (string->uri uri-scheme uri-path) > #:export (options->transformation > manifest-entry-with-transformations >=20=20 > @@ -106,15 +107,25 @@ extensions." > (define* (package-with-source p uri #:optional version) > "Return a package based on P but with its source taken from URI. Extr= act > the new package's version number from URI." > - (let ((base (tarball-base-name (basename uri)))) > + (let ((base (tarball-base-name (basename uri))) > + (file (match (string->uri uri) > + (#f uri) > + (uri (and (eq? 'file (uri-scheme uri)) > + (uri-path uri)))))) > (let-values (((_ version*) > (hyphen-package-name->name+version base))) > (package (inherit p) > (version (or version version* > (package-version p))) >=20=20 > - ;; Use #:recursive? #t to allow for directories. > - (source (downloaded-file uri #t)))))) > + ;; Default to #:recursive? #f to match what 'url-fetch' d= oes, > + ;; but use #t when URI denotes a directory. > + (source (let ((recursive? > + (and file > + (match (stat file #f) > + (#f #t) > + (st (eq? 'directory (stat:type st))= ))))) > + (downloaded-file uri recursive?))))))) LGTM! Cheers, simon