-
Notifications
You must be signed in to change notification settings - Fork 470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
d2layout-dagre: Compile fully statically with musl libc #31
Comments
Another possible approach is to compile with qemu. I believe this is how code-server now handles cross compilation. |
On nvm, qemu would help us avoid needing to maintain a builder of each architecture and OS but we'd still need one of each OS at the least. I don't think there's any easy way to cross compile for a different platform apart from using zig which I'll need to research further. |
Relevant: rogchap/v8go#170 |
https://xeiaso.net/blog/carcinization-golang we could also compile v8 to wasm and execute in a pure go wasm runtime instead. then no cgo at all! |
This currently fully breaks build on musl, including of the d2 command itself (not just d2plugin-dagre). Is there no easy way to cut this out and require e.g. a library to be present on the system, or something else like that? |
d2 imports d2plugin-dagre by default. But the d2 command itself is pure Go. You can use Line 1 in f64ed49
or The only pure Go layout engine we currently have is TALA which requires a license. See https://github.com/terrastruct/tala |
@alixander damn nice how did you know that someone opened a PR fixing it? |
i brieflyz considering calling React from Go for server side renders (probably won't go with that), and the potential extra reliance on v8go made me investigate its activity. |
Can also try https://github.com/dop251/goja? |
Also means it will be far easier to do #136 when there's no cgo involved. |
Ok maybe not far given the dagre/elk javascript can just run in the browser lol. |
omg what if we just embedded the node binary? code-server used to do this thing where they embedded the node binary/js into a single binary. they probably still do. we could do it too. |
we can close this now that goja's worked. |
See https://honnef.co/posts/2015/06/statically_compiled_go_programs__always__even_with_cgo__using_musl/
The text was updated successfully, but these errors were encountered: