tractordev / wanix

Experimental, local-first, web-native, Unix-like development environment
https://wanix.sh
MIT License
206 stars 11 forks source link

Compile Build tool pkg.zip from source #56

Closed Parzival-3141 closed 6 months ago

Parzival-3141 commented 6 months ago

Currently the build tool requires a pkg.zip containing the compile and link WASM tools and Go binary archives for stdlib and other libraries for linking. We'd rather not pollute the repo with a 51MB file, so we have to be clever.

One idea is just building from source; Pull dependencies, compile link and compile tools, compile libraries to Go binary archives, construct importcfgs, and zip everything up at build time. Compiling libraries to Go archives is potentially a pitfall, as Go doesn't actually have an official way to do this. However, through some testing it seems our go install -a -work hack might work if we use a main.go just containing imports. We may still run into package version mismatching issues though, I'm not sure.

Other than that building from source seems doable!