diff mbox series

[bug#54216,staging,v3] gnu: shepherd: Build it from git, and clean up shepherd-for-guix.

Message ID 20220321170716.20140-1-attila@lendvai.name
State New
Headers show
Series [bug#54216,staging,v3] gnu: shepherd: Build it from git, and clean up shepherd-for-guix. | expand

Checks

Context Check Description
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Attila Lendvai March 21, 2022, 5:07 p.m. UTC
* gnu/packages/admin.scm (shepherd): Change SOURCE to point to the git repository.
(shepherd-for-guix): Simplify by moving most of the customizations into the above.
---

also updated/rebased the cleanup patch to point to the commit that
includes #:resource-limit in Shepherd.

 gnu/packages/admin.scm | 72 +++++++++++++++++-------------------------
 1 file changed, 29 insertions(+), 43 deletions(-)

Comments

Attila Lendvai March 22, 2022, 9:27 a.m. UTC | #1
just a quick idea:

another solution could be to introduce a shepherd-tools package that only contains the command line tools, and packages would depend on this one, not shepherd itself.

that way shepherd could be updated cheaply, and as long as the socket interface remains compatible, the shepherd-tools package doesn't need to be updated (which is expensive in the current dependency graph).

--
• attila lendvai
• PGP: 963F 5D5F 45C7 DFCD 0A39
--
“I cannot imagine a torture more vicious and terrifying than to realize in the face of one’s final days that one wasted his entire life trying to please the plethora of idiots around him, instead of educating them and himself and molding tomorrow for the better.”
	— Brandon Smith, 'Alt-Market blog'
Attila Lendvai March 22, 2022, 1:48 p.m. UTC | #2
i really wish if this patch progressed, and if Guix master included the #:resource-limits commit sooner than later.

Ludo, can you please point out more precisely what is your concern? i'd be happy to reshape the patches accordingly.

1) including an unreleased Shepherd in Guix

2) building Shepherd from git instead of a release tarball

3) adding a secondary shepherd package

4) the currently proposed names/setup of the secondary shepherd package

5) ?

the rationale for this patch is discussed above, but to sum it up:

- several packages depend on shepherd, therefore updating it results in a long recompile (currently shepherd patches must also go into staging). this greatly increases the edit-compile-test cycle of hacking on shepherd and testing it "in place" using `guix system vm`.

- using git as source plays better with SWH and simplifies building a different version of shepherd.

--
• attila lendvai
• PGP: 963F 5D5F 45C7 DFCD 0A39
--
Every lie is a debt to the truth.
pelzflorian (Florian Pelz) March 22, 2022, 2:42 p.m. UTC | #3
On Tue, Mar 22, 2022 at 01:48:53PM +0000, Attila Lendvai wrote:
> - several packages depend on shepherd, therefore updating it results in a long recompile (currently shepherd patches must also go into staging). this greatly increases the edit-compile-test cycle of hacking on shepherd and testing it "in place" using `guix system vm`.

I'm not sure but have you checked if grafting is an option alternative to this shepherd-next package?

See <https://issues.guix.gnu.org/54199#3>.

The rest of the rationale may be reason enough for this patch though.

Regards,
Florian
Attila Lendvai March 28, 2022, 9:07 a.m. UTC | #4
> I'm not sure but have you checked if grafting is an option alternative to this shepherd-next package?
>
> See https://issues.guix.gnu.org/54199#3.

FTR, no, i haven't yet. the reason is that i still haven't
internalized a model of how grafting works.

i'm happy to refocus my attention to grafting if someone with a better
bird's eye view perspective tells me that it's the preferred solution
in this context.

your pointer is much appreciated, though! and recorded in my notes,
too.

--
• attila lendvai
• PGP: 963F 5D5F 45C7 DFCD 0A39
--
“Surprise exists in the map, not in the territory.”
	— Eliezer Yudkowsky (1979–)
diff mbox series

Patch

diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index 27fc33e990..3f08447ba4 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -270,26 +270,32 @@  (define-public shepherd
   (package
     (name "shepherd")
     (version "0.8.1")
-    (source (origin
-              (method url-fetch)
-              (uri (string-append "mirror://gnu/shepherd/shepherd-"
-                                  version ".tar.gz"))
-              (sha256
-               (base32
-                "0x9zr0x3xvk4qkb6jnda451d5iyrl06cz1bjzjsm0lxvjj3fabyk"))
-              (modules '((guix build utils)))
-              (snippet
-               '(begin
-                  ;; Build with -O1 to work around <https://bugs.gnu.org/48368>.
-                  (substitute* "Makefile.in"
-                    (("compile --target")
-                     "compile -O1 --target"))))))
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://git.savannah.gnu.org/git/shepherd.git/")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "109ha9rk4ycqcmx9cddlbym92c3fvbwp12q9p42h8sg8vr367w5j"))
+       (modules '((guix build utils)))))
     (build-system gnu-build-system)
     (arguments
      '(#:configure-flags '("--localstatedir=/var")
-       #:make-flags '("GUILE_AUTO_COMPILE=0")))
+       #:make-flags '("GUILE_AUTO_COMPILE=0")
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'strip) ; Avoid some warnings from stripping .go files.
+         ;; TODO delete this once Guile is updated to v3.0.8+
+         (add-after 'unpack 'patch-source
+           (lambda _
+             ;; Build with -O1 to work around <https://bugs.gnu.org/48368>.
+             (substitute* "Makefile.am"
+               (("compile --target")
+                "compile -O1 --target")))))))
     (native-inputs
-     (list pkg-config
+     (list autoconf automake gettext-minimal help2man texinfo pkg-config
            ;; This is the Guile we use as a cross-compiler...
            guile-3.0))
     (inputs
@@ -314,46 +320,26 @@  (define-public shepherd
 ;; [TODO] in the manual.
 (define-public shepherd-for-guix
   (let* ((version "0.8.1")
-         ;; If it's an unreleased commit:
+         ;; A commit string, or #f if it's a release.
          (commit "3ee9a7193d73821d6f1dd76a745ed5e4bb1a78c8")
-         ;; Use the below form if it's a release, and also set REVISION to #f.
-         ;; (commit (string-append "v" version))
-         (revision "1"))
+         (revision "1") ; Only relevant when COMMIT is specified.
+         (git-ref (or commit (string-append "v" version))))
     (package
       (inherit shepherd)
-      (version (if revision
+      (version (if commit
                    (git-version version revision commit)
                    version))
       (source
        (origin
          (inherit (package-source shepherd))
-         (method git-fetch)
          (uri (git-reference
                ;; Build from git and add Autotools inputs, to make developing
                ;; Shepherd easier. It enables easier package inheritance.
                (url "https://git.savannah.gnu.org/git/shepherd.git/")
-               (commit commit)))
-         (snippet #f) ; TODO delete this once parent is refactored.
+               (commit git-ref)))
          (sha256
-          (base32
-           "07zaazw33p98n38j9hgjaipjvbh9mf0x3b5nbri5nyrxbgn0vvvb"))))
-      ;; TODO merge this back into the parent with a patch to staging.
-      (arguments
-       (append
-        (package-arguments shepherd)
-        '(#:phases
-          (modify-phases %standard-phases
-            (delete 'strip) ; Avoid some warnings from stripping .go files.
-            (add-after 'unpack 'patch-source
-              (lambda _
-                ;; Build with -O1 to work around <https://bugs.gnu.org/48368>.
-                (substitute* "Makefile.am"
-                  (("compile --target")
-                   "compile -O1 --target"))))))))
-      (native-inputs
-       (modify-inputs (package-native-inputs shepherd)
-         (prepend autoconf automake gettext-minimal help2man texinfo)))
-      (description "A package variant for use in Guix. It helps lowering
+          (base32 "07zaazw33p98n38j9hgjaipjvbh9mf0x3b5nbri5nyrxbgn0vvvb"))))
+      (description "A package variant for use in Guix.  It helps lowering
 the build time of Guix when working on Shepherd."))))
 
 (define-public guile2.2-shepherd