From: Hilton Chain <hako@ultrarare.space>
To: 74217@debbugs.gnu.org
Cc: "Motiejus Jakštys" <motiejus@jakstys.lt>,
"Noé Lopez" <noe@xn--no-cja.eu>, dan <i@dan.games>,
"Efraim Flashner" <efraim@flashner.co.il>,
"Ekaitz Zarraga" <ekaitz@elenq.tech>
Subject: bug#74217: Bootstrapping Zig with no Binary Blobs
Date: Sat, 07 Dec 2024 22:07:22 +0800 [thread overview]
Message-ID: <87o71nh9id.wl-hako@ultrarare.space> (raw)
In-Reply-To: <87r06mprul.wl-hako@ultrarare.space>
On Thu, 05 Dec 2024 14:27:14 +0800,
Hilton Chain wrote:
>
> On Mon, 02 Dec 2024 13:11:53 +0800,
> Hilton Chain wrote:
> >
> > On Thu, 28 Nov 2024 19:08:09 +0800,
> > Hilton Chain wrote:
> > >
> > > Made "#:zig-inputs" a private keyword, its value will be passed to inputs like
> > > cargo-build-system (the build system doesn't extract the whole closure for
> > > now, this can be added in the future depending on how Zig ecosystem develops).
> >
> > Just thought if we can avoid using #:zig-inputs, it turns out doing so is quite
> > easy:
>
> Added two procedures producing origin snippets in (gnu packages zig-xyz).
>
> 'add-build.zig.zon' for generating build.zig.zon, currently unused.
> 'rename-zig-dependencies' for replacing #:zig-inputs.
Moved to (gnu packages zig).
> I'll try to make unpack-dependencies phase reading dependencies from
> build.zig.zon instead of input labels so that we can have more specificity.
Changed install path for Zig packages to /src/zig, added a GUIX_ZIG_PACKAGE_PATH
search path (currently only in Zig 0.13 to avoid rebuilds).
Phase unpack-dependencies is changed to:
1. Find dependencies in build.zig.zon.
2. Find inputs in GUIX_ZIG_PACKAGE_PATH.
3. Per dependency, invoke "zig fetch" on matched input ('^dependency[-.]?', this
pattern expands available specificity to minor version, in case it's unavoidable
to propagate multiple versions of the same package into build environment).
With above changes, it's possible to reuse dependencies packaged in Guix, for example:
--8<---------------cut here---------------start------------->8---
cd $(mktemp -d)
cp --recursive --no-preserve=all $(<...>/pre-inst-env guix build --source zig-httpz)/. .
<...>/pre-inst-env guix shell --development zig-httpz
<...>/pre-inst-env guile -c "((@@ (guix build zig-build-system) unpack-dependencies))"
zig build
--8<---------------cut here---------------end--------------->8---
--8<---------------cut here---------------start------------->8---
cd $(mktemp -d)
git clone https://github.com/karlseguin/http.zig && cd http.zig
git checkout zig-0.13
<...>/pre-inst-env guile -c "(eval ((@ (gnu packages zig) rename-zig-dependencies) '((\"metrics\" . \"zig-metrics\") (\"websocket\" . \"zig-websocket\"))) (interaction-environment))"
<...>/pre-inst-env guix shell zig zig-metrics zig-websocket
<...>/pre-inst-env guile -c "((@@ (guix build zig-build-system) unpack-dependencies))"
zig build
--8<---------------cut here---------------end--------------->8---
next prev parent reply other threads:[~2024-12-07 14:09 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-05 21:47 bug#74217: Bootstrapping Zig with no Binary Blobs Ekaitz Zarraga
2024-11-07 1:19 ` Hilton Chain via Bug reports for GNU Guix
2024-11-07 22:06 ` Noé Lopez via Bug reports for GNU Guix
2024-11-07 22:09 ` Ekaitz Zarraga
2024-11-11 11:42 ` Efraim Flashner
2024-11-11 11:56 ` Hilton Chain via Bug reports for GNU Guix
2024-11-11 12:02 ` Efraim Flashner
2024-11-08 17:43 ` bug#74217: [PATCH 0/2] Initial step on bootstrapping Zig Hilton Chain via Bug reports for GNU Guix
2024-11-08 17:44 ` bug#74217: [PATCH 1/2] gnu: Add zig-0.10.0-610-bootstrap Hilton Chain via Bug reports for GNU Guix
2024-11-08 17:44 ` bug#74217: [PATCH 2/2] gnu: Add zig-0.10.0-610 Hilton Chain via Bug reports for GNU Guix
2024-11-09 17:26 ` bug#74217: [PATCH 0/2] Initial step on bootstrapping Zig Hilton Chain via Bug reports for GNU Guix
2024-11-13 16:46 ` bug#74217: Bootstrapping Zig with no Binary Blobs Hilton Chain via Bug reports for GNU Guix
2024-11-13 18:10 ` Efraim Flashner
2024-11-13 23:40 ` Hilton Chain via Bug reports for GNU Guix
2024-11-14 1:05 ` Hilton Chain via Bug reports for GNU Guix
2024-11-14 6:05 ` Hilton Chain via Bug reports for GNU Guix
2024-11-14 9:22 ` Hilton Chain via Bug reports for GNU Guix
2024-11-14 9:41 ` Efraim Flashner
2024-11-15 3:29 ` Hilton Chain via Bug reports for GNU Guix
2024-11-15 14:30 ` Hilton Chain via Bug reports for GNU Guix
2024-11-16 6:54 ` Hilton Chain via Bug reports for GNU Guix
2024-11-16 7:13 ` Motiejus Jakštys
2024-11-16 7:18 ` Hilton Chain via Bug reports for GNU Guix
2024-11-16 17:03 ` Efraim Flashner
2024-11-16 18:59 ` Hilton Chain via Bug reports for GNU Guix
2024-11-17 1:39 ` Hilton Chain via Bug reports for GNU Guix
2024-11-17 7:16 ` Efraim Flashner
2024-11-17 14:51 ` Hilton Chain via Bug reports for GNU Guix
2024-11-18 12:00 ` Hilton Chain via Bug reports for GNU Guix
2024-11-19 13:13 ` Hilton Chain via Bug reports for GNU Guix
2024-11-21 13:06 ` Hilton Chain via Bug reports for GNU Guix
2024-11-28 11:08 ` Hilton Chain via Bug reports for GNU Guix
2024-11-28 12:41 ` Motiejus Jakštys
2024-11-28 15:20 ` Hilton Chain via Bug reports for GNU Guix
2024-11-28 20:12 ` Motiejus Jakštys
2024-11-28 20:14 ` Motiejus Jakštys
2024-11-28 20:53 ` Motiejus Jakštys
2024-11-29 12:25 ` Hilton Chain via Bug reports for GNU Guix
2024-11-29 14:51 ` Hilton Chain via Bug reports for GNU Guix
2024-12-01 19:32 ` Motiejus Jakštys
2024-12-02 7:40 ` Efraim Flashner
2024-12-02 5:11 ` Hilton Chain
2024-12-05 6:27 ` Hilton Chain
2024-12-07 14:07 ` Hilton Chain [this message]
2024-11-14 9:47 ` Motiejus Jakštys
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=87o71nh9id.wl-hako@ultrarare.space \
--to=hako@ultrarare.space \
--cc=74217@debbugs.gnu.org \
--cc=efraim@flashner.co.il \
--cc=ekaitz@elenq.tech \
--cc=i@dan.games \
--cc=motiejus@jakstys.lt \
--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 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).