unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Z572 via Guix-patches via <guix-patches@gnu.org>
To: zimoun <zimon.toutoune@gmail.com>
Cc: 47754@debbugs.gnu.org
Subject: [bug#47754] [PATCH] gnu: transformations: fix with-latest option for git source package.
Date: Thu, 04 Nov 2021 19:17:38 +0800	[thread overview]
Message-ID: <tencent_5BF03A4AE5EB25D5B5999B7AA98559627F08@qq.com> (raw)
Message-ID: <87v918ceyc.fsf@qq.com> (raw)
In-Reply-To: <CAJ3okZ3EcDmmPJ2nHjtv+dH_rGQT-cWVeGZ66AmZQyDaE+hxfA@mail.gmail.com>



zimoun <zimon.toutoune@gmail.com> 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 <upstream-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




  reply	other threads:[~2021-11-04 11:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87a6q2i1x2.fsf@qq.com>
2021-04-13 16:28 ` [bug#47754] [PATCH] gnu: transformations: fix with-latest option for git source package Z572
2021-11-03 10:18   ` zimoun
     [not found]     ` <87wnlp45k3.fsf@qq.com>
2021-11-03 14:54       ` Z572 via Guix-patches via
2021-11-03 16:18         ` zimoun
     [not found]           ` <87v918ceyc.fsf@qq.com>
2021-11-04 11:17             ` Z572 via Guix-patches via [this message]
2021-11-06 18:17               ` zimoun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tencent_5BF03A4AE5EB25D5B5999B7AA98559627F08@qq.com \
    --to=guix-patches@gnu.org \
    --cc=47754@debbugs.gnu.org \
    --cc=873216071@qq.com \
    --cc=zimon.toutoune@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).