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!
Currently the build tool requires a
pkg.zip
containing thecompile
andlink
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
andcompile
tools, compile libraries to Go binary archives, constructimportcfg
s, 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 ourgo install -a -work
hack might work if we use amain.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!