Re: [Feature Request/Postmortem] Adding a way to compile GNU Guile scripts to a standalone executable

Noé Lopez <[email protected]> Tue, 12 Aug 2025 11:33:47 +0200
Newsgroups gmane.lisp.guile.devel
Message-ID <[email protected]>
> That didn't turn out well since Guile relies so much on Guix. And Guix dumps the binaries it compiles into /gnu/store and not inside of my CMake project, which is not good.
>
> Besides, I also feel like using CMake is a losing battle anyways, since it would tie it to a C++ build system. Instead, what I'd probably want to do is have a guile script that runs and builds everything together. Fortunately, there is prior art: https://git.dthompson.us/chickadee/tree/chickadee/cli/bundle.scm, which was used for davexunit.itch.io/bonnie-bee<https://davexunit.itch.io/bonnie-bee>
> https://davexunit.itch.io/super-bloom
>
> The big problem I can think of when it comes to making a more generalized guile build system is that guile relies heavily on the Guix ecosystem, and everything in Guix is installed globally in /gnu/store. (Unless you do guix pack -RR of course). I don't know Guix SUPER well, but I think you could probably have your guile script inside a guix pack, and then run the script once you unzip it. However, I don't think that would work on windows, and also isn't the one-click executable I want.
>

guix pack -f appimage would do the one-click executable for linux.

> So I guess after all of this, I really want to hear your thoughts on this effort. Should I keep trying to make this work? I'd love to submit a Pull Request at some point making this all work, but I want to know where I should put my attention into.
>

It sounds like a cool idea! I haven’t looked at what you have in detail
but consider that making it as an AppImage would work well for Linux, I
don’t know much about windows but I suppose there exists similar
container formats in which you can put your guile binary and scripts and
have it execute seemlessly.

The advantage of AppImage instead of having to code your own bootstrap.c
is that it will be able to load dynamic libraries as well as guile
scripts from a SquashFS archive that is contained in the binary.

I think a good way forward would be to extend chickadee’s bundle to
generate AppImages instead of tarballs.

Good day!
Noé
signature.asc (application/pgp-signature, 682 B)
-----BEGIN PGP SIGNATURE-----

iQHFBAEBCAAvFiEEXVTPJVeyOOiNwYCiLSIyQQq3QEMFAmibCnsRHG5vZWxvcGV6
QGZyZWUuZnIACgkQLSIyQQq3QENb9QwA7xauRoUlVompf0VNPJfssQuVOe8S1Msz
d0xrNxCGRqo93nOBP0FUZGdJNkKU4/kkVzpOWOnT1xEZ80WLAPuGMxjXEeN5SrpB
dWiqBeyB5/iWgOK1jCofRPpMlptVa1ETI5sqR8KRQQtPczzlCuIQP7Wo4K87Tlgr
u3XIbq84sPI7PYnoGu1g9cz323JD6mghk17y1HUhX4uBJ4dFlW+Y9fJYUb2sAGpN
6Q4EZ3a2sdy/ChsctPCTvzTPOfqd1FdPlK9XNG08fNDqEM1Nwycl0su+156VYV8I
6SSbyClBs1SDhAydd40z/DwRtSi9HitTYZXaDQEMzuT7j8JgtGoQfu+6Witp2BwM
TWnnG/qNFCyNqIq6mfteAJWGJuOCaxZJjd/8DLS9hU0uNBeG4GK1iNeZsHQEGosm
auif1PYuJKikPAqCdo3rRA8z3BBzOxIX7ZgDLg/ttI//VdRSyaQ7rG3hT5VDDZyU
8KGSmMFTqtUHk/Gtro3Oj790rsrLc0Wj
=zIGh
-----END PGP SIGNATURE-----