zimoun <zimon.toutoune@gmail.com> writes:
Toggle quote (30 lines)
> 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"
>> 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
> $ file $(guix build r-soupx -S)
> /gnu/store/1z0j6i4a9xwwd8d3955m7vq3f1x4p3aq-r-soupx-0.3.1-1.a3354be-checkout:
> 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:
(define-gexp-compiler (upstream-source-compiler (source <upstream-source>)
"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)))
-> (and=> (upstream-source-signature-urls source)
(tarball ((store-lift download-tarball) url signature)))
(raise (formatted-message (G_ "failed to fetch source from '~a'")
;; 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)
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".