StanzaOrg / lbstanza-old

L.B. Stanza Programming Language
Other
216 stars 23 forks source link

Bootstrapping ? #187

Open callendorph opened 1 year ago

callendorph commented 1 year ago

I'm trying to build a docker image for use in CI. I've successfully created a docker image using ubuntu here:

https://github.com/callendorph/lbstanza-docker

This image is functional - I can build and run stanza projects for testing. The resultant image is large (470MB) because the ubuntu image isn't optimized for size.

I would like to try building with alpine as I think I can get that down to about 150MB (majority (90MB) is the stanza pkgs). The problem is that stanza won't run in alpine:

$> docker run -it --rm stanza help
exec /opt/stanza/stanza: no such file or directory

Further inspection:

7b2d48858d94:/$ ldd /opt/stanza/stanza
    /lib64/ld-linux-x86-64.so.2 (0x7f74500a5000)
    libm.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7f74500a5000)
    libdl.so.2 => /lib64/ld-linux-x86-64.so.2 (0x7f74500a5000)
    libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x7f744fe57000)
    librt.so.1 => /lib64/ld-linux-x86-64.so.2 (0x7f74500a5000)
    libpthread.so.0 => /lib64/ld-linux-x86-64.so.2 (0x7f74500a5000)
    libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x7f744fe39000)
    libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7f74500a5000)
Error relocating /opt/stanza/stanza: __printf_chk: symbol not found
Error relocating /opt/stanza/stanza: __snprintf_chk: symbol not found
Error relocating /opt/stanza/stanza: __vsnprintf_chk: symbol not found
Error relocating /opt/stanza/stanza: __memcpy_chk: symbol not found

The executable definitely exists and I'm not doing anything dumb. Alpine uses musl and busybox so it isn't using the standard glibc and shells. It can't find various symbols. stanza has to be recompiled in order to run in this environment.

I realize that bootstrapping stanza may not exactly be a trivial endeavor. Any suggestions ? Is there any documentation regarding bootstrapping ?