I figure that should be fine. We just need an implementation of dlopen
. But either of them will also require a dynamic loader (ld.so
) available to be able to actually load shared libraries. That’s probably the most challenging problem because a statically linked binary misses that.
And that works I suppose there might then appear issues with libraries that are statically linked into the compiler and dynamically loaded by the interpreted program.
Ah, If I understand correctly, libdl
ships with libc
(which Crystal uses musl
because glibc
doesn’t work with static linking well?), and the since libdl
isn’t available when linking statically, could it be provided with the binary?
Would that require building musl
along with static Crystal and exporting them together? Or are there other challenges?
It doesn’t seem to matter too much, as this only appears to be a problem with using a static build. I can do a dynamic build on my own without much problems.
Is the interpreter also be available on windows ?
What made me happy today is that I can now use the Crystal interpreter installed with apt install crystal
on my new Ubuntu 24.04 (Noble Numbat) . I always wanted an interpreter, so I used to build Crystal from source and use sudo checkinstall
, but that may not be necessary anymore.
I don’t know who contributed to this, but I’m very grateful. Thank you!
That would be @deiv, according to https://changelogs.ubuntu.com/changelogs/pool/universe/c/crystal/crystal_1.11.2+dfsg-1build3/changelog
crystal (1.9.2+dfsg-2) unstable; urgency=medium
- Recover 1.6.0+dfsg-3 version lost changes (Closes: #1043235).
- Build interpreter again.
– David Suárez deiv@debian.org Tue, 08 Aug 2023 16:24:42 +0200
Welcome ;)
I have Ubuntu 24.04 and the official crystal packages are definitelly without interpreter support (Crystal was compiled without interpreter support).
My package URI from /etc/apt is:
http://download.opensuse.org/repositories/devel:/languages:/crystal/xUbuntu_24.04/
So… How?
We’re talking about the downstream package in the Ubuntu 24.04 repository: Ubuntu – Details of package crystal in noble
Note that this repository lags behind, though. So you won’t get the latest release.
Our own packages from devel:languages:crystal
on OBS will always be up to date. But they don’t have interpreter support yet.
A post was split to a new topic: libdl
on Windows
There’s a trick that allows fully-portable yet dynamically linked builds. This could allow us shipping portable builds with the interpreter.