all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Hilton Chain <hako@ultrarare.space>
To: "Noé Lopez" <noe@xn--no-cja.eu>
Cc: Ekaitz Zarraga <ekaitz@elenq.tech>, 74656@debbugs.gnu.org
Subject: bug#74656: [wip-zig-bootstrap] zig cache is not updated for dependencies of dependencies
Date: Tue, 03 Dec 2024 08:43:09 +0800	[thread overview]
Message-ID: <875xo11tr6.wl-hako@ultrarare.space> (raw)
In-Reply-To: <87ed2p7pmn.fsf@xn--no-cja.eu>

[-- Attachment #1: Type: text/plain, Size: 1775 bytes --]

Hi Noé,

On Tue, 03 Dec 2024 05:15:44 +0800,
Noé Lopez wrote:
>
> [1  <text/plain; utf-8 (quoted-printable)>]
> Hi,
>
> I got my hands on packaging liskvork, a gomoku server.  The build fails
> because dependencies of dependencies are not added to the zig cache, and so
> can’t be found correctly by the zig build system.
>
> I attached a patch that reproduces this, a workaround when reproducing the
> steps in a local checkout is to call “zig fetch” on the missing dependencies:
>
> $ zig fetch /gnu/store/j0x1vl6w2vgr3fz60l4jgyx5gx53af61-zig-httpz-0-0.7d2ddae/src/zig-httpz-0-0.7d2ddae --save=httpz
> warning: overwriting existing dependency named 'httpz'
> $ zig build --summary all
> /home/noe/.cache/zig/p/1220476906a8f57d6cbaaaeb05d44a41311a5bb6ca74bb86bc3aa1467506c241b29b/build.zig.zon:7:20: error: invalid URI: UnexpectedCharacter
> $ zig fetch /gnu/store/59w4s1g1y4vy4gw3mwn9fjsfcqc5454i-zig-metrics-0-0.fcf9e94/src/zig-metrics-0-0.fcf9e94 --save=metrics
> $ zig fetch /gnu/store/izxqkxplp7alrh0n3c8j8cv277nqa04a-zig-websocket-0-0.cf89cb8/src/zig-websocket-0-0.cf89cb8 --save=websocket
> $ zig build --summary all
> Build Summary: 5/5 steps succeeded
> install success
> +- install liskvork success
>    +- zig build-exe liskvork Debug native-native success 3s MaxRSS:276M
>       +- options cached
>       +- options cached
>
> This has the issue of adding the packages to build.zig.zon, so a better
> solution is required.
>
> I’m attaching the patch with the liskvork package and dependencies. The error
> can be reproduced with “./pre-inst-env guix build liskvork”.
>
> Have a nice day,
> Noé

Good example, that's the current limitation of #:zig-inputs, and I'm planning to
remove it.

Please apply the attached patch onto your change.

Thanks

[-- Attachment #2: zig-xyz.patch --]
[-- Type: text/plain, Size: 4160 bytes --]

diff --git a/gnu/packages/zig-xyz.scm b/gnu/packages/zig-xyz.scm
index 027377fa1b..b98a160e27 100644
--- a/gnu/packages/zig-xyz.scm
+++ b/gnu/packages/zig-xyz.scm
@@ -186,11 +186,20 @@ (define-public zig-logz
                 (file-name (git-file-name name version))
                 (sha256
                  (base32
-                  "01xihyvyx3rpv0kvjh6mg1b99d6agq683q4iyn39nwqb6ma0i0sz"))))
+                  "01xihyvyx3rpv0kvjh6mg1b99d6agq683q4iyn39nwqb6ma0i0sz"))
+                (modules '((guix build utils)))
+                (snippet
+                 #~(for-each
+                    (lambda (dep)
+                      (substitute* "build.zig"
+                        (((string-append "(b\\.dependency.\")" (car dep)) _ prefix)
+                         (string-append prefix (cdr dep))))
+                      (substitute* "build.zig.zon"
+                        (((string-append "\\." (car dep)))
+                         (format #f ".@\"~a\"" (cdr dep)))))
+                    '(("metrics" . "zig-metrics"))))))
       (build-system zig-build-system)
-      (arguments
-       (list
-        #:zig-inputs `(("metrics" ,zig-metrics))))
+      (propagated-inputs (list zig-metrics))
       (home-page "https://github.com/karlseguin/log.zig")
       (synopsis "Structured Logging for Zig")
       (description "logz is an opinionated structured logger that outputs to stdout,
@@ -265,12 +274,21 @@ (define-public zig-httpz
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "02hixvyx1r04lg0nzvhkyrqwcwm8m8rs8hm01n2nzw6jv935frh8"))))
+                "02hixvyx1r04lg0nzvhkyrqwcwm8m8rs8hm01n2nzw6jv935frh8"))
+              (modules '((guix build utils)))
+              (snippet
+               #~(for-each
+                  (lambda (dep)
+                    (substitute* "build.zig"
+                      (((string-append "(b\\.dependency.\")" (car dep)) _ prefix)
+                       (string-append prefix (cdr dep))))
+                    (substitute* "build.zig.zon"
+                      (((string-append "\\." (car dep)))
+                       (format #f ".@\"~a\"" (cdr dep)))))
+                  '(("metrics" . "zig-metrics")
+                    ("websocket" . "zig-websocket"))))))
     (build-system zig-build-system)
-    (arguments
-     (list #:zig-inputs
-           `(("metrics" ,zig-metrics)
-             ("websocket" ,zig-websocket))))
+    (propagated-inputs (list zig-metrics zig-websocket))
     (home-page "https://github.com/karlseguin/http.zig")
     (synopsis "HTTP/1.1 server for Zig")
     (description "")
@@ -288,16 +306,26 @@ (define-public liskvork
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "1x7cif9wpaq7mk1pqmixq3flymrradb6zpx5qnmiihw699zr2xhw"))))
+                "1x7cif9wpaq7mk1pqmixq3flymrradb6zpx5qnmiihw699zr2xhw"))
+              (modules '((guix build utils)))
+              (snippet
+               #~(for-each
+                  (lambda (dep)
+                    (substitute* "build.zig"
+                      (((string-append "(b\\.dependency.\")" (car dep)) _ prefix)
+                       (string-append prefix (cdr dep))))
+                    (substitute* "build.zig.zon"
+                      (((string-append "\\." (car dep)))
+                       (format #f ".@\"~a\"" (cdr dep)))))
+                  '(("ini" . "zig-ini")
+                    ("logz" . "zig-logz")
+                    ("zul" . "zig-zul")
+                    ("httpz" . "zig-httpz"))))))
     (build-system zig-build-system)
     (arguments
      (list #:install-source? #f
-           #:zig-release-type "safe"
-           #:zig-inputs
-           `(("ini" ,zig-ini)
-             ("logz" ,zig-logz)
-             ("zul" ,zig-zul)
-             ("httpz" ,zig-httpz))))
+           #:zig-release-type "safe"))
+    (inputs (list zig-httpz zig-ini zig-logz zig-zul))
     (home-page "https://liskvork.org")
     (synopsis "Modern multi-platform gomoku game server.")
     (description "liskvork is a modern Gomoku game server that is purpose-built for

  reply	other threads:[~2024-12-03  1:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-02 21:15 bug#74656: [wip-zig-bootstrap] zig cache is not updated for dependencies of dependencies Noé Lopez via Bug reports for GNU Guix
2024-12-03  0:43 ` Hilton Chain [this message]
2024-12-03  9:56   ` Noé Lopez via Bug reports for GNU Guix
2024-12-03 17:07     ` Hilton Chain

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

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

  git send-email \
    --in-reply-to=875xo11tr6.wl-hako@ultrarare.space \
    --to=hako@ultrarare.space \
    --cc=74656@debbugs.gnu.org \
    --cc=ekaitz@elenq.tech \
    --cc=noe@xn--no-cja.eu \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.