From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id uMNSCdrKg2HAFwAAgWs5BA (envelope-from ) for ; Thu, 04 Nov 2021 12:58:18 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id GAALBdrKg2FmGgAAB5/wlQ (envelope-from ) for ; Thu, 04 Nov 2021 11:58:18 +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 9399B3CE72 for ; Thu, 4 Nov 2021 12:58:17 +0100 (CET) Received: from localhost ([::1]:52290 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mibNo-0000ce-Dv for larch@yhetil.org; Thu, 04 Nov 2021 07:58:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55128) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mibNa-0000cW-4C for guix-patches@gnu.org; Thu, 04 Nov 2021 07:58:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:58867) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mibNZ-00075x-SH for guix-patches@gnu.org; Thu, 04 Nov 2021 07:58:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mibNZ-0006GP-PG for guix-patches@gnu.org; Thu, 04 Nov 2021 07:58:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#47754] [PATCH] gnu: transformations: fix with-latest option for git source package. Resent-From: Z572 <873216071@qq.com> Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 04 Nov 2021 11:58:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47754 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: zimoun Cc: 47754@debbugs.gnu.org Received: via spool by 47754-submit@debbugs.gnu.org id=B47754.163602705324037 (code B ref 47754); Thu, 04 Nov 2021 11:58:01 +0000 Received: (at 47754) by debbugs.gnu.org; 4 Nov 2021 11:57:33 +0000 Received: from localhost ([127.0.0.1]:42180 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mibN7-0006Fd-1b for submit@debbugs.gnu.org; Thu, 04 Nov 2021 07:57:33 -0400 Received: from out203-205-251-72.mail.qq.com ([203.205.251.72]:57813) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <873216071@qq.com>) id 1mibN0-0006FH-Cm for 47754@debbugs.gnu.org; Thu, 04 Nov 2021 07:57:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1636027038; bh=HCwXUcrZLfxnWHFULJgDEe0d6CrDv4+Zp6a6C0RHFdA=; h=References:From:To:Cc:Subject:Date:In-reply-to; b=iyeYvGbxsIwRKCYU/R2bZm3TMFvHTt4YK/K/INLnCO0Ld3bhsEhqedToXrQzP8B3F Wq1mka9Q2De/ZfkVSwN1U7rzsm2TpSnePP1SgdD9qmFxD+fDTk6Pdo9Wd3sTowvlX7 jwdt1I3m3zZ8DvAPsHbjVNruoel9kbagjpWlGXLQ= Received: from asus ([2409:8928:1202:153f:198d:cdf:6e3a:f9d1]) by newxmesmtplogicsvrszc6.qq.com (NewEsmtp) with SMTP id DF7A6632; Thu, 04 Nov 2021 19:55:55 +0800 X-QQ-mid: xmsmtpt1636026955twr10c8qn Message-ID: X-QQ-XMAILINFO: OE2SNMSfMbmO4VnJlJf/UZPqrkQ6rwnyPQg/cgTkRTSPK5fatS291oEnBmiRSY btJpP3XYI1vueLJcl3e21ruAiLYq74TgRyvUmzBsoyUA9gaRshoUT16p3N7awaxo+e3B+FQSD6+r on+vxssIFUqsZhDvCFuBPJBRnYRm9bc56lU55+kiVirW5BDZM4vr0rJy7+ZKWgPGb/+eLccFLIfL 201/4MyhgROQa1Khg7oU23QiGz6kRH/BM9NxHo63IHWPFlZ6hYkkOVX6VjIubQr1jqvwPGgxXY91 CSleztKNzPnn8o/DAIzh5Du6/eRHyBObMMSQQf8ztc8dbi68nUfj8GVSodHJQ2G2eKeXTKKrYmak EIT+Lv0ksGbEZxj/bIuDtJvPQ3qFDBo3z9hYCk3BwXjTWg5a4xrfQDJiMzUQdmQeyZSaXOInjX0M H5DBvyZ6BkVZI/jQjTcDiu9lHS67HQHvYuyz3l5by5nR+yP4HpiSvwAZubykG7HgzBOdRFR/ltrV WTXA7Iy2s/bGeUofDrjVmQbgugMkHx/6ASglAIRUwjLL8SOHt45VaW2TrEcxyVchOM3Mi56Inx/K pN2ZSpJ14A7/f3epvTc2ShzaKIEc9ck3rHfFd6a79hMbGuZv3tyTr6u1x48DzxKqvQMNvew4aQiZ OECAHaTaBhke+3wD60j8rMN0D8gjaYOyro3jVr25ilLOOg6It4xaVXsIWOxyyWU6qeTMmp5v0jky /g5SlwPGfWv2SdwQ9IwZA0ccvqb+ABaG3ApLlVD3JDWK8Vu0Sew1++Wv0qwLyQkYKywErqWHAs/K dvIttAGXQvknVcyujeYu6r References: <87y265sfsr.fsf@gmail.com> User-agent: mu4e 1.6.9; emacs 28.0.50 Date: Thu, 04 Nov 2021 19:17:38 +0800 In-reply-to: Message-ID: <87v918ceyc.fsf@qq.com> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" Reply-to: Z572 <873216071@qq.com> X-ACL-Warn: , Z572 via Guix-patches From: Z572 via Guix-patches via X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1636027097; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: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=HCwXUcrZLfxnWHFULJgDEe0d6CrDv4+Zp6a6C0RHFdA=; b=MxpjEBZYbiVdXmE5IIQ5NGGY8JkAtCxB+jNcl9iDiFK4dVGxjZ3Mer2y4QinJA0C0a5XRE Xp5c6hn2vMfZr0V1l298lJscgKYpxemvRTaqJsLhOEjvBOJ4o2eSR4QStdo1sx1qLsoRI3 Y1Hse+1fRnHDrW1kj9flYm3Qi4H7kax98Lxi/u9fALX9WkpLh3Gr5hS1C6Bz6IsG780BqB Gc+h6Rn1DD5RmkVpQhCTYj9rT+igkYVosKayt9vTk5xk1l+ylly81ho64+4Avu7jKZ+s0F rzHQsaRQM24+Vxs9sScP45OLAa/oCpNn6HtlErqzH0HamgoryuZ9a+V1YzXOew== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1636027097; a=rsa-sha256; cv=none; b=PfnS1hkv32/2g4M9gL4dlfyFSDzZCg9JBCLJzouEiru4UuuIutu9EFDoxUftF7AP80LCn7 lAQhLrctWXrOypu1Ji04qaQZb1/uoTNPicZLYKItVoa4qmESvMX5h2j79erIv/Cwo41vZG oi0jraewyD7u6QA8br+3ZlEmSncg099hpNTJBWcdF1ILEA8ANuS3X0QPRh2L+05696zcuV gVOpSdYBnmms54HNrhRNWjOu4Yy97QxnRBXPF6hYPxaMVbKSjXDAVZgax3ojlEcuWIruZR NQHlXPv/BEaFuJ1mpPpobsp9PwW04DObyf6ZpYYuVbLA9/LyOK5RwhT3UqAfwQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=qq.com header.s=s201512 header.b=iyeYvGbx; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: 3.48 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=qq.com header.s=s201512 header.b=iyeYvGbx; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 9399B3CE72 X-Spam-Score: 3.48 X-Migadu-Scanner: scn0.migadu.com X-TUID: HgSnQt98e6Oy zimoun writes: > Hi, > > On Wed, 3 Nov 2021 at 16:34, Z572 <873216071@qq.com> wrote: > >> $ file `guix build fbreader --with-latest=fbreader -S` >> /gnu/store/rdqkmjpiig9gddzsxj4mdyw8lvn944xg-FBReader: HTML document, >> UTF-8 Unicode text, with very long lines > >> If a package is a git source package, after use "with-latest" >> option, it's url >> will become to it's source. and build will fail. >> >> This patch just fix this. > > I see. However, I am not convinced your example is correct, because > for instance, > > $ file $(guix build r-soupx -S) > /gnu/store/1z0j6i4a9xwwd8d3955m7vq3f1x4p3aq-r-soupx-0.3.1-1.a3354be-checkout: > directory > > What you are seeing is: Git upstream source is modified by Guix (for > instance, patches are applied or files are removed; in the field > 'origin') and "guix build -S" returns what Guix actually builds, not > what upstream provides. Therefore, in this case, the modified source > is returned as compressed archive. However, when using the > transformation 'with-latest', in this case, "guix build -S > --with-latest" returns what upstream provides, thus a directory (or > something else as a file). I looked source again, just because of "upstream-source-compiler" don't support git source package, all will become to use url-fetch. See (guix upstream) module: ``` scheme (define-gexp-compiler (upstream-source-compiler (source ) system target) "Download SOURCE from its first URL and lower it as a fixed-output derivation that would fetch it." (mlet* %store-monad ((url -> (first (upstream-source-urls source))) (signature -> (and=> (upstream-source-signature-urls source) first)) (tarball ((store-lift download-tarball) url signature))) (unless tarball (raise (formatted-message (G_ "failed to fetch source from '~a'") url))) ;; Instead of returning TARBALL, return a fixed-output derivation that ;; would be able to re-download it. In practice, since TARBALL is already ;; in the store, no extra download will happen, but having the derivation ;; in store improves provenance tracking. (let ((hash (call-with-input-file tarball port-sha256))) (url-fetch url 'sha256 hash (store-path-package-name tarball) #:system system)))) ``` I'm have no idea how to change it, so i just check if package is git-source, use "git-checkout" instead of "upstream-source". > > Maybe I miss something, but from me, the inconsistency comes from the > behavior of "guix build -S", not about the behaviour of 'with-latest' > transformation. And I also miss why the build would fail. > > > Cheers, > simon -- over