digitalmars.D - Running a website using a 1.3MB self-contained executable
- Andrea Fontana (31/31) Jan 19 I’ve published an example showcasing how to use serverino to
- Sebastiaan Koppe (5/9) Jan 20 Awesome. I tried this many times but due to (transitive)
- Andrea Fontana (5/15) Jan 20 In this case musl worked! You can see the workflow here:
- Johan (9/19) Jan 20 LDC 1.39 and up has improved support of musl, including CI
I’ve published an example showcasing how to use serverino to serve a web server that generates QR codes, without any external dependencies (not even glibc) and without reading or writing any files to disk. It’s a single file, 1.3MB in size, which you can try by downloading it from the project’s GitHub page: https://github.com/trikko/serverino-demo/ or by checking the result at https://test.andreafontana.it. The file can run inside a Docker scratch container or completely isolated from the rest of the system with bwrap, and it works perfectly! Using upx/gzexe size goes down to <500KB If you want to try serverino: ``` █▀▀▀▀▀█ █▄▀ ███ ▄█▄ █▀▀▀▀▀█ █ ███ █ ▀█▄▄█▀█▄▄▄ █▄ █ ███ █ █ ▀▀▀ █ ▀▀▀▀ █▄▀ █▀ █ ▀▀▀ █ ▀▀▀▀▀▀▀ ▀ ▀▄▀ █▄█ ▀ █ ▀▀▀▀▀▀▀ █▄▄█▀█▀▀██▄ ▄▀█▄▀█▄█▀█ ▄█ ██▀ ▄▀▀ ▄▀ ▀▀ █ ██ ▄ █▄▄█▀▄▀ ▄ ▄ ██ ▀██▄███▀▀▄█▄█▀ ██▄▄▄▄█ ▄▀▄▄ ▄▀▄▄▀█▀▄▄█▀▄▀ █▀▀▀▄█ █ █ █▄▄ █▀▀▄ ▄ ▄▀ ▄ ▄ █▀▀ ▄▀▄▄ ██ ▄▄ ▀▀▄▀▄███▀█▀ ▀█ ▄ ▀█▄ ▀ ▀▀▀▀ ▀▀▀███▄▀█ █ ▀▄ █▀▀▀██▀▀ █▀▀▀▀▀█ █▀ ▄▄█ ▀▀█ ██ ▀ █▀ ▄ █ ███ █ █ ███▄██ ▀▀█▀▀▀▀ ▀█ █ ▀▀▀ █ ▄ ▀▀▀ █▀▀█ ▀▀▄█▀▄█▀█ ▀▀▀▀▀▀▀ ▀ ▀▀▀▀ ▀▀ ▀ ▀ ``` Andrea Fontana
Jan 19
On Sunday, 19 January 2025 at 21:17:29 UTC, Andrea Fontana wrote:I’ve published an example showcasing how to use serverino to serve a web server that generates QR codes, without any external dependencies (not even glibc) and without reading or writing any files to disk.Awesome. I tried this many times but due to (transitive) dependencies on glibc always had to give up (e.g. gethostname). Switching to musl often failed as well because it isn't as supported as glibc in druntime.
Jan 20
On Monday, 20 January 2025 at 08:55:43 UTC, Sebastiaan Koppe wrote:On Sunday, 19 January 2025 at 21:17:29 UTC, Andrea Fontana wrote:In this case musl worked! You can see the workflow here: https://github.com/trikko/serverino-demo/blob/main/.github/workflows/main.yml AndreaI’ve published an example showcasing how to use serverino to serve a web server that generates QR codes, without any external dependencies (not even glibc) and without reading or writing any files to disk.Awesome. I tried this many times but due to (transitive) dependencies on glibc always had to give up (e.g. gethostname). Switching to musl often failed as well because it isn't as supported as glibc in druntime.
Jan 20
On Monday, 20 January 2025 at 08:55:43 UTC, Sebastiaan Koppe wrote:On Sunday, 19 January 2025 at 21:17:29 UTC, Andrea Fontana wrote:LDC 1.39 and up has improved support of musl, including CI testing on Alpine. Pretty soon there will also be alpine-musl release packages of LDC on Github: https://github.com/ldc-developers/ldc/pull/4826 thanks to kinke's work. cheers, JohanI’ve published an example showcasing how to use serverino to serve a web server that generates QR codes, without any external dependencies (not even glibc) and without reading or writing any files to disk.Awesome. I tried this many times but due to (transitive) dependencies on glibc always had to give up (e.g. gethostname). Switching to musl often failed as well because it isn't as supported as glibc in druntime.
Jan 20