jprendes / emception

Run Emscripten in the browser
Other
285 stars 35 forks source link

Add CI action to build WASM #23

Closed thegecko closed 10 months ago

thegecko commented 10 months ago

This PR should add a GitHub action which builds the llvm WASM file (about 2 hours).

If triggered using a tag, a package should also be published onto the GitHub npm registry with emscripten types to allow the WASM file to be imported by another project e.g.:

import LlvmBoxModule from '@jprendes/emception';
...
async #init(LlvmBoxModule, FS, opts) {
...

This was developed to separate our usage of llvm-box from a consuming project. Feel free to use it as inspiration if something else is required in this project

jprendes commented 10 months ago

Thanks for the PR! This is not using npmjs.com's registry but rather github's npm registry, right?

jprendes commented 10 months ago

I think the CI problem is with -it in docker run. Changing it to -i should fix the failure.

thegecko commented 10 months ago

This is not using npmjs.com's registry but rather github's npm registry, right?

that's right

I think the CI problem is with -it in docker run. Changing it to -i should fix the failure.

thanks, forgot to change that

jprendes commented 10 months ago

LGTM

thegecko commented 10 months ago

Although the action succeeded, it failed to find the output files, does this look right?

        ./build/llvm/bin/llvm-box.wasm
        ./build/llvm/bin/llvm-box.mjs
jprendes commented 10 months ago

Nop, that doesn't look correct. Do you have bandwidth to take a look?

thegecko commented 10 months ago

Ok, could you tell me where the output llvm wasm and mjs files end up? I don't have a set up I can look at

jprendes commented 10 months ago

hm, I just checked, and the two files should be there: ./build/llvm/bin/llvm-box.{wasm,mjs}

thegecko commented 10 months ago

OK, I'll build locally and see whats going on