d2 icon indicating copy to clipboard operation
d2 copied to clipboard

install.sh: Windows support

Open alixander opened this issue 2 years ago • 5 comments

just dealing with CGO

alixander avatar Nov 15 '22 22:11 alixander

https://news.ycombinator.com/item?id=33711040

alixander avatar Nov 22 '22 20:11 alixander

  • [ ] build host
  • [ ] terraauth update to support windows

In regards to the install script, idt it's worth adding a windows powershell/cmd.exe variant. Rather we add a https://chocolatey.org/ package instead.

nhooyr avatar Nov 22 '22 21:11 nhooyr

Opened https://github.com/terrastruct/d2/issues/154

nhooyr avatar Nov 22 '22 21:11 nhooyr

just adding another: https://news.ycombinator.com/item?id=33713748

alixander avatar Nov 23 '22 01:11 alixander

https://news.ycombinator.com/item?id=33714812

we could have install.sh working under git bash for sure I think

nhooyr avatar Nov 23 '22 05:11 nhooyr

For tomorrow's release, I'll most likely just build windows releases manually.

nhooyr avatar Dec 01 '22 18:12 nhooyr

Damn, sorry guys it looks like v8go doesn't even support windows anymore :(

https://github.com/rogchap/v8go#windows

I'm going to try and work around it but will need more time.

nhooyr avatar Dec 02 '22 23:12 nhooyr

Also see https://github.com/terrastruct/d2/issues/31.

I could try to compile v8 with emscripten to wasm and then run the JS with the wasm bundle under a go wasm runtime like https://github.com/wasmerio/wasmer-go (though it uses cgo it builds on windows). Or compiling the JS directly to wasm with something like https://github.com/Shopify/javy#build

And try out https://github.com/dop251/goja because with pure Go

As well as see if bundling the node binary is into our Go binary is feasible, then no cgo necessary.

nhooyr avatar Dec 03 '22 08:12 nhooyr

@nhooyr i will give https://github.com/dop251/goja a try.

alixander avatar Dec 03 '22 17:12 alixander

still working through some things but the fact it runs is promising. https://github.com/terrastruct/d2/pull/337

alixander avatar Dec 03 '22 18:12 alixander

dagre is pretty small though. whether it can handle Mathjax's build is a bigger question

alixander avatar Dec 03 '22 18:12 alixander

good fucking find. v8go has been replaced with Goja. should be all good for full windows build

alixander avatar Dec 03 '22 20:12 alixander

Screenshot 2022-12-06 at 2 55 27 AM

nhooyr avatar Dec 06 '22 10:12 nhooyr

See https://github.com/terrastruct/d2/pull/378

nhooyr avatar Dec 06 '22 11:12 nhooyr