bug-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#43893: [PATCH] maint: update-guix-package: Optionally add sources to


From: Ludovic Courtès
Subject: bug#43893: [PATCH] maint: update-guix-package: Optionally add sources to store.
Date: Mon, 09 Nov 2020 23:18:33 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:

> Following discussions in <https://issues.guix.gnu.org/43893>, keeping a copy
> of the updated package source is desirable when generating a release.

Not just when generating a release: anytime you want to refer to a
private commit, which could be for mere testing.

> * build-aux/update-guix-package.scm (version-controlled?): Remove variable.
> (call-with-temporary-git-worktree): Renamed from
> 'with-temporary-git-worktree'.  Update doc.  Do not change directory
> implicitly.
> (keep-source-in-store): New procedure.
> (main): Adjust to use with call-with-temporary-git-worktree.  Add the sources
> to the store when GUIX_ALLOW_ME_TO_USE_PRIVATE_COMMIT is set.
> * .dir-locals.el (scheme-mode): Update.
> * doc/contributing.texi (Updating the Guix Package): Update doc.
>
> Co-authored-by: Ludovic Courtès <ludo@gnu.org>

[...]

> -(define-syntax-rule (with-temporary-git-worktree commit body ...)
> -  "Execute BODY in the context of a temporary git worktree created from 
> COMMIT."
> +(define-syntax-rule (call-with-temporary-git-worktree commit proc)
> +  "Execute PROC in the context of a temporary git worktree created from
> +COMMIT.  PROC receives the temporary directory file name as an argument."

This could be a procedure rather a macro now.

[...]

> +       (call-with-temporary-git-worktree commit
> +           (lambda (tmp-directory)
> +             (let* ((hash (nix-base32-string->bytevector
> +                           (string-trim-both
> +                            (with-output-to-string
> +                           (lambda ()
> +                             (guix-hash "-rx" tmp-directory))))))
> +                    (location (package-definition-location))
> +                    (old-hash (content-hash-value
> +                               (origin-hash (package-source guix)))))
> +               (edit-expression location
> +                                (update-definition commit hash
> +                                                   #:old-hash old-hash
> +                                                   #:version version))
> +               ;; When GUIX_ALLOW_ME_TO_USE_PRIVATE_COMMIT is set, the 
> sources are
> +               ;; added to the store.  This is used as part of 'make 
> release'.
> +               (when (getenv "GUIX_ALLOW_ME_TO_USE_PRIVATE_COMMIT")
> +                 (with-store store
> +                   (keep-source-in-store store tmp-directory))))))))

OK, that should do the job.

Thanks for the patch, that should break the deadlock and allow us to
proceed with the release!

Next we need to update the ‘release’ target so
GUIX_ALLOW_ME_TO_USE_PRIVATE_COMMIT is set.

I like that the initial issue is fixed, but I still don’t buy the extra
dependency on Git, the extra copies of the whole tree, the extra code,
and the shell pipelines, something avoided in the rest of Guix.  Perhaps
that suggests there are unwritten coding guidelines we should eventually
discuss and write.  We’ll see!

Thanks,
Ludo’.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]