livebud / bud

The Full-Stack Web Framework for Go
MIT License
5.58k stars 179 forks source link

Ship statically linked binaries? #399

Open vito opened 1 year ago

vito commented 1 year ago

This might be difficult, since I'm not sure how the internals work with V8 and all that jazz.

In short, I can't use the binaries shipped in the GitHub releases because they link to libstdc++.so.6. I'm trying to run bud in a container built with Nix, which doesn't have these dependencies installed to the typical locations. In general, a statically linked binary is much more portable.

Setting CGO_ENABLED=0 is usually enough, but there are corner cases.

Thanks, and hope you're doing well!

matthewmueller commented 1 year ago

Hey Alex, nice to hear from you!

I didn't realize the V8 build included dynamic libraries. We should definitely make this optional, though I think this would be difficult right now while bud is still tied to Svelte + V8 (w/ CGO).

I'm currently working on making the views more pluggable. I'd also like to adjust Svelte to use https://github.com/livebud/js, which abstracts over V8 and Goja, both of which work with Svelte's SSR renderer.

I was planning to do this swap once I pried Svelte out of core, but it should also be possible today by refactoring the current Svelte package.