unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Bootstrapping Zig with no binary blobs: status update and call for packages.
@ 2024-11-29 14:39 ` Hilton Chain
  2024-12-01 23:19   ` Hilton Chain
                     ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Hilton Chain @ 2024-11-29 14:39 UTC (permalink / raw)
  To: guix-devel
  Cc: dan, Efraim Flashner, Ekaitz Zarraga, Motiejus Jakštys,
	Noé Lopez

Hello Guix!

After working on 'wip-zig-bootstrap' branch for the past month[1], I'm glad to
say it's ready for testing now!

+ Zig is bootstrapped to the current release, 0.13.0!

Greatly thanks to Motiejus!  I cannot find out the way without them finishing
the trickiest part.  They have also published a blog post[2].

You can now use Zig 0.13.0 and everything on wip-zig-bootstrap via
‘guix time-machine’, for example:
--8<---------------cut here---------------start------------->8---
guix time-machine \
        --no-channel-files \
        --branch=wip-zig-bootstrap \
        -- shell zig@0.13
--8<---------------cut here---------------end--------------->8---

Building 0.13 from the beginning of bootstrap chain takes around 5 hours on my
machine.  Efraim is building the branch on berlin so there should be some
substitutes on ci.guix.gnu.org, at least for sources.

Patches for adjusting linking behavior have been applied to all release versions
we currently have (0.9.1, 0.10.1, 0.11.0, 0.12.1, 0.13.0).  They should work
just fine without any extra workaround, please report to [1] if you encounter
any issue.

+ Cross build and Zig package manager support are available in zig-build-system.

zig-build-system now by default installs source under "/src" of package output.
Like in go-build-system, this can be disabled by setting #:install-source? to #f.

Other new arguments, #:skip-build? and #:zig-inputs, like the ones in
cargo-build-system, are available.  Note that packages and sources in
#:zig-inputs must have their output names starting with "zig-".

Example packages are available in (gnu packages zig-xyz) on wip-zig-bootstrap[3].

These new features need testing, please send your favorite packages to
guix-patches@gnu.org, targeting wip-zig-bootstrap and prefixed with "zig-team",
the more the better :)


Cheers,
Hilton
---
[1]: Bootstrapping Zig with no Binary Blobs
     https://issues.guix.gnu.org/74217

[2]: Zig Reproduced Without Binaries
     https://jakstys.lt/2024/zig-reproduced-without-binaries/

[3]: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/zig-xyz.scm?h=wip-zig-bootstrap


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Bootstrapping Zig with no binary blobs: status update and call for packages.
@ 2024-12-01 20:39 Ashvith Shetty
  2024-11-29 14:39 ` Hilton Chain
  0 siblings, 1 reply; 13+ messages in thread
From: Ashvith Shetty @ 2024-12-01 20:39 UTC (permalink / raw)
  To: hako; +Cc: efraim, ekaitz, guix-devel, i, motiejus, noe

Hi Hilton,

There's a lot of builds happening (perhaps related to the Zig 
sub-versions) when I try to build Zig 0.13 locally to test building a 
package of my choice. Is there a way to navigate this blocker?

Regards,
Ashvith




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Bootstrapping Zig with no binary blobs: status update and call for packages.
  2024-11-29 14:39 ` Hilton Chain
@ 2024-12-01 23:19   ` Hilton Chain
  2024-12-02  7:34     ` Efraim Flashner
  2024-12-02 11:30     ` Ashvith Shetty
  2024-12-02 13:18   ` Ludovic Courtès
                     ` (2 subsequent siblings)
  3 siblings, 2 replies; 13+ messages in thread
From: Hilton Chain @ 2024-12-01 23:19 UTC (permalink / raw)
  To: Ashvith Shetty
  Cc: dan, Efraim Flashner, Ekaitz Zarraga, guix-devel,
	Motiejus Jakštys, Noé Lopez

Hi Ashvith,

On Mon, 02 Dec 2024 04:39:09 +0800,
Ashvith Shetty wrote:
>
> There's a lot of builds happening (perhaps related to the Zig sub-versions)
> when I try to build Zig 0.13 locally to test building a package of my
> choice. Is there a way to navigate this blocker?

I'm building them on my server so there're substitutes on [1], I didn't mention
it before because it requires extra authorization.

Thanks
---
[1]: https://substitute.boiledscript.com


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Bootstrapping Zig with no binary blobs: status update and call for packages.
  2024-12-01 23:19   ` Hilton Chain
@ 2024-12-02  7:34     ` Efraim Flashner
  2024-12-02 11:30     ` Ashvith Shetty
  1 sibling, 0 replies; 13+ messages in thread
From: Efraim Flashner @ 2024-12-02  7:34 UTC (permalink / raw)
  To: Hilton Chain
  Cc: Ashvith Shetty, dan, Ekaitz Zarraga, guix-devel,
	Motiejus Jakštys, Noé Lopez

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

On Mon, Dec 02, 2024 at 07:19:11AM +0800, Hilton Chain wrote:
> Hi Ashvith,
> 
> On Mon, 02 Dec 2024 04:39:09 +0800,
> Ashvith Shetty wrote:
> >
> > There's a lot of builds happening (perhaps related to the Zig sub-versions)
> > when I try to build Zig 0.13 locally to test building a package of my
> > choice. Is there a way to navigate this blocker?
> 
> I'm building them on my server so there're substitutes on [1], I didn't mention
> it before because it requires extra authorization.
> 
> Thanks
> ---
> [1]: https://substitute.boiledscript.com

Also the substitutes on berlin (ci.guix.gnu.org) might need to be baked
before they're served.  So if it says there aren't substitutes it may be
worth waiting a few minutes and asking again to see if they just hadn't
been requested previously.

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Bootstrapping Zig with no binary blobs: status update and call for packages.
  2024-12-01 23:19   ` Hilton Chain
  2024-12-02  7:34     ` Efraim Flashner
@ 2024-12-02 11:30     ` Ashvith Shetty
  2024-12-03 15:37       ` Hilton Chain
  1 sibling, 1 reply; 13+ messages in thread
From: Ashvith Shetty @ 2024-12-02 11:30 UTC (permalink / raw)
  To: Hilton Chain
  Cc: dan, Efraim Flashner, Ekaitz Zarraga, guix-devel,
	Motiejus Jakštys, Noé Lopez

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

Hi Hilton,

I left the build running overnight, and that did the job for me.

Bun is a little tricky to package, as it requires providing a modified
JavaScript core from oven-sh/WebKit <https://github.com/oven-sh/WebKit>,
and then there's a bunch of other dependencies that aren't clearly
specified. To be honest, I am not even sure which tag to start with, would
appreciate some guidance here.

So far, I've packaged waylock. Since I am on Xorg for the time-being, I
would really appreciate it if anyone using Wayland would test this
<https://codeberg.org/Ashvith/guix/src/branch/add-waylock> out - because
the PAM configuration
<https://codeberg.org/ifreund/waylock/src/branch/master/pam.d/waylock> may
have to be modified from system-auth to login - however, I could not get
swaylock working, which has "auth include login" by default.

Regards,
Ashvith

[-- Attachment #2: Type: text/html, Size: 1067 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Bootstrapping Zig with no binary blobs: status update and call for packages.
  2024-11-29 14:39 ` Hilton Chain
  2024-12-01 23:19   ` Hilton Chain
@ 2024-12-02 13:18   ` Ludovic Courtès
  2024-12-05  6:28   ` Hilton Chain
  2024-12-31 15:39   ` Bootstrapped Zig now available in Guix master Hilton Chain
  3 siblings, 0 replies; 13+ messages in thread
From: Ludovic Courtès @ 2024-12-02 13:18 UTC (permalink / raw)
  To: Hilton Chain
  Cc: guix-devel, dan, Efraim Flashner, Ekaitz Zarraga,
	Motiejus Jakštys, Noé Lopez

Hello Hilton,

Hilton Chain <hako@ultrarare.space> skribis:

> After working on 'wip-zig-bootstrap' branch for the past month[1], I'm glad to
> say it's ready for testing now!

This is quite an achievement, congrats!

Ludo’.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Bootstrapping Zig with no binary blobs: status update and call for packages.
  2024-12-02 11:30     ` Ashvith Shetty
@ 2024-12-03 15:37       ` Hilton Chain
  2024-12-04 17:57         ` Hilton Chain
  0 siblings, 1 reply; 13+ messages in thread
From: Hilton Chain @ 2024-12-03 15:37 UTC (permalink / raw)
  To: Ashvith Shetty
  Cc: dan, Efraim Flashner, Ekaitz Zarraga, guix-devel,
	Motiejus Jakštys, Noé Lopez

On Mon, 02 Dec 2024 19:30:38 +0800,
Ashvith Shetty wrote:
>
> [1  <text/plain; UTF-8 (7bit)>]
> I left the build running overnight, and that did the job for me.
>
> Bun is a little tricky to package, as it requires providing a modified
> JavaScript core from oven-sh/WebKit <https://github.com/oven-sh/WebKit>,
> and then there's a bunch of other dependencies that aren't clearly
> specified. To be honest, I am not even sure which tag to start with, would
> appreciate some guidance here.

Looks complex, and has bootstrappability issue it seems.

> So far, I've packaged waylock. Since I am on Xorg for the time-being, I
> would really appreciate it if anyone using Wayland would test this
> <https://codeberg.org/Ashvith/guix/src/branch/add-waylock> out - because
> the PAM configuration
> <https://codeberg.org/ifreund/waylock/src/branch/master/pam.d/waylock> may
> have to be modified from system-auth to login - however, I could not get
> swaylock working, which has "auth include login" by default.

Package works for me.  That file won't be used, screen-locker-service-type will
generate one instead.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Bootstrapping Zig with no binary blobs: status update and call for packages.
  2024-12-03 15:37       ` Hilton Chain
@ 2024-12-04 17:57         ` Hilton Chain
  0 siblings, 0 replies; 13+ messages in thread
From: Hilton Chain @ 2024-12-04 17:57 UTC (permalink / raw)
  To: Ashvith Shetty
  Cc: dan, Efraim Flashner, Ekaitz Zarraga, guix-devel,
	Motiejus Jakštys, Noé Lopez

On Tue, 03 Dec 2024 23:37:01 +0800,
Hilton Chain wrote:
>
> On Mon, 02 Dec 2024 19:30:38 +0800,
> Ashvith Shetty wrote:
> >
> > So far, I've packaged waylock. Since I am on Xorg for the time-being, I
> > would really appreciate it if anyone using Wayland would test this
> > <https://codeberg.org/Ashvith/guix/src/branch/add-waylock> out - because
> > the PAM configuration
> > <https://codeberg.org/ifreund/waylock/src/branch/master/pam.d/waylock> may
> > have to be modified from system-auth to login - however, I could not get
> > swaylock working, which has "auth include login" by default.
>
> Package works for me.  That file won't be used, screen-locker-service-type will
> generate one instead.

Applied your waylock package to wip-zig-bootstrap with some adjustments.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Bootstrapping Zig with no binary blobs: status update and call for packages.
  2024-11-29 14:39 ` Hilton Chain
  2024-12-01 23:19   ` Hilton Chain
  2024-12-02 13:18   ` Ludovic Courtès
@ 2024-12-05  6:28   ` Hilton Chain
  2024-12-31 15:39   ` Bootstrapped Zig now available in Guix master Hilton Chain
  3 siblings, 0 replies; 13+ messages in thread
From: Hilton Chain @ 2024-12-05  6:28 UTC (permalink / raw)
  To: guix-devel
  Cc: dan, Efraim Flashner, Ekaitz Zarraga, Motiejus Jakštys,
	Noé Lopez

On Fri, 29 Nov 2024 22:39:10 +0800,
Hilton Chain wrote:
>
> Other new arguments, #:skip-build? and #:zig-inputs, like the ones in
> cargo-build-system, are available.  Note that packages and sources in
> #:zig-inputs must have their output names starting with "zig-".

Amend: #:zig-inputs will be removed in the end.  Now it's recommended to add Zig
dependencies to the standard inputs and propagated-inputs fields, and change
dependency names within package sources instead of embed the name mapping into
build system arguments.

A new procedure 'rename-zig-dependencies' is added for producing the needed
origin snippet.  Examples are available in zig-xyz.scm.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Bootstrapped Zig now available in Guix master.
  2024-11-29 14:39 ` Hilton Chain
                     ` (2 preceding siblings ...)
  2024-12-05  6:28   ` Hilton Chain
@ 2024-12-31 15:39   ` Hilton Chain
  2024-12-31 15:57     ` Ekaitz Zarraga
  3 siblings, 1 reply; 13+ messages in thread
From: Hilton Chain @ 2024-12-31 15:39 UTC (permalink / raw)
  To: guix-devel
  Cc: dan, Efraim Flashner, Ekaitz Zarraga, Motiejus Jakštys,
	Noé Lopez

Hi Guix,

Zig 0.13.0 is now available in master!

It's worth mentioning that some build steps can be used in shell as well:

Reusing packaged dependencies with `unpack-dependencies' from
`(guix build zig-build-system)':
--8<---------------cut here---------------start------------->8---
# Example: river
git clone https://codeberg.org/river/river && cd river && git checkout v0.3.6
guix shell --development river
echo "((assoc-ref (@ (guix build zig-build-system) %standard-phases) 'unpack-dependencies))" | guix repl -t machine
zig build
--8<---------------cut here---------------end--------------->8---

Additionally with `rename-zig-dependencies' from `(gnu packages zig)':
--8<---------------cut here---------------start------------->8---
# Example: zig-zls@0.13
git clone https://github.com/zigtools/zls && cd zls && git checkout 0.13.0
echo "(eval ((@ (gnu packages zig) rename-zig-dependencies) \
        '((\"diffz\" . \"zig-diffz\") \
          (\"known_folders\" . \"zig-known-folders\"))) \
        (interaction-environment))" | guix repl -t machine
guix shell --development zig-zls@0.13
echo "((assoc-ref (@ (guix build zig-build-system) %standard-phases) 'unpack-dependencies))" | guix repl -t machine
zig build
--8<---------------cut here---------------end--------------->8---


Happy New Year :)


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Bootstrapped Zig now available in Guix master.
  2024-12-31 15:39   ` Bootstrapped Zig now available in Guix master Hilton Chain
@ 2024-12-31 15:57     ` Ekaitz Zarraga
  2025-01-01  5:25       ` Pjotr Prins
  0 siblings, 1 reply; 13+ messages in thread
From: Ekaitz Zarraga @ 2024-12-31 15:57 UTC (permalink / raw)
  To: Hilton Chain, guix-devel
  Cc: dan, Efraim Flashner, Motiejus Jakštys, Noé Lopez

On 2024-12-31 4:39 PM, Hilton Chain wrote:
> Hi Guix,
> 
> Zig 0.13.0 is now available in master!
> 
> It's worth mentioning that some build steps can be used in shell as well:
> 
> Reusing packaged dependencies with `unpack-dependencies' from
> `(guix build zig-build-system)':
> --8<---------------cut here---------------start------------->8---
> # Example: river
> git clone https://codeberg.org/river/river && cd river && git checkout v0.3.6
> guix shell --development river
> echo "((assoc-ref (@ (guix build zig-build-system) %standard-phases) 'unpack-dependencies))" | guix repl -t machine
> zig build
> --8<---------------cut here---------------end--------------->8---
> 
> Additionally with `rename-zig-dependencies' from `(gnu packages zig)':
> --8<---------------cut here---------------start------------->8---
> # Example: zig-zls@0.13
> git clone https://github.com/zigtools/zls && cd zls && git checkout 0.13.0
> echo "(eval ((@ (gnu packages zig) rename-zig-dependencies) \
>          '((\"diffz\" . \"zig-diffz\") \
>            (\"known_folders\" . \"zig-known-folders\"))) \
>          (interaction-environment))" | guix repl -t machine
> guix shell --development zig-zls@0.13
> echo "((assoc-ref (@ (guix build zig-build-system) %standard-phases) 'unpack-dependencies))" | guix repl -t machine
> zig build
> --8<---------------cut here---------------end--------------->8---
> 
> 
> Happy New Year :)

Oh!

Great achievement!

As told in IRC, I think we should write something about this, in the 
line of the Mono bootstrap post. Zig people would enjoy it, and also 
Guix people.

It's a great opportunity to let people know how hard is to bootstrap 
Zig, Rust and some other languages, and make them focus a little bit 
more on the language bootstrappability.

I offer myself as a reviewer for the blogpost, if you decide to go that 
route and write one.

Thanks for making this. I followed this effort closely, even if I didn't 
have the chance to take part.

Today Guix is a little bit more comfortable for me thanks to this.

Happy New Year.

Ekaitz


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Bootstrapped Zig now available in Guix master.
  2024-12-31 15:57     ` Ekaitz Zarraga
@ 2025-01-01  5:25       ` Pjotr Prins
  2025-01-03 14:38         ` Hilton Chain
  0 siblings, 1 reply; 13+ messages in thread
From: Pjotr Prins @ 2025-01-01  5:25 UTC (permalink / raw)
  To: Ekaitz Zarraga
  Cc: Hilton Chain, guix-devel, dan, Efraim Flashner,
	Motiejus Jakštys, Noé Lopez

On Tue, Dec 31, 2024 at 04:57:22PM +0100, Ekaitz Zarraga wrote:
> As told in IRC, I think we should write something about this, in the line of
> the Mono bootstrap post. Zig people would enjoy it, and also Guix people.
> 
> It's a great opportunity to let people know how hard is to bootstrap Zig,
> Rust and some other languages, and make them focus a little bit more on the
> language bootstrappability.

Absolutely! Zig is still not in other distros because of this. Julia
has similar problems. The problem is that language developers live in
their own silo, create a self-hosted compiler with binary blob, and
leave it to the distros to figure it out. Hopefully the bootstrap
can carry on and other distros pick up on it. Zig deserves attention.

Great job.

Pj.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Bootstrapped Zig now available in Guix master.
  2025-01-01  5:25       ` Pjotr Prins
@ 2025-01-03 14:38         ` Hilton Chain
  0 siblings, 0 replies; 13+ messages in thread
From: Hilton Chain @ 2025-01-03 14:38 UTC (permalink / raw)
  To: Pjotr Prins
  Cc: Ekaitz Zarraga, guix-devel, dan, Efraim Flashner,
	Motiejus Jakštys, Noé Lopez

On Wed, 01 Jan 2025 13:25:37 +0800,
Pjotr Prins wrote:
>
> On Tue, Dec 31, 2024 at 04:57:22PM +0100, Ekaitz Zarraga wrote:
> > As told in IRC, I think we should write something about this, in the line of
> > the Mono bootstrap post. Zig people would enjoy it, and also Guix people.
> >
> > It's a great opportunity to let people know how hard is to bootstrap Zig,
> > Rust and some other languages, and make them focus a little bit more on the
> > language bootstrappability.
>
> Absolutely! Zig is still not in other distros because of this. Julia
> has similar problems. The problem is that language developers live in
> their own silo, create a self-hosted compiler with binary blob, and
> leave it to the distros to figure it out. Hopefully the bootstrap
> can carry on and other distros pick up on it. Zig deserves attention.

I can try to write a post this month, but please don't have much expectation on
it, I'm in no way good at writing :)


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2025-01-03 14:42 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-01 20:39 Bootstrapping Zig with no binary blobs: status update and call for packages Ashvith Shetty
2024-11-29 14:39 ` Hilton Chain
2024-12-01 23:19   ` Hilton Chain
2024-12-02  7:34     ` Efraim Flashner
2024-12-02 11:30     ` Ashvith Shetty
2024-12-03 15:37       ` Hilton Chain
2024-12-04 17:57         ` Hilton Chain
2024-12-02 13:18   ` Ludovic Courtès
2024-12-05  6:28   ` Hilton Chain
2024-12-31 15:39   ` Bootstrapped Zig now available in Guix master Hilton Chain
2024-12-31 15:57     ` Ekaitz Zarraga
2025-01-01  5:25       ` Pjotr Prins
2025-01-03 14:38         ` Hilton Chain

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).