kpreid / all-is-cubes

Yet another block/voxel game; in this one the blocks are made out of blocks. Runs in browsers on WebGL+WebAssembly.
https://kpreid.dreamwidth.org/tag/all+is+cubes
Apache License 2.0
160 stars 8 forks source link

Wasm workspace separation #410

Open kpreid opened 11 months ago

kpreid commented 11 months ago

Currently, all-is-cubes-wasm is a member of the main workspace. This is inconvenient, because it has dependencies that won't compile on desktop platforms, and other packages have dependencies that won't compile on Wasm. Currently, this is being addressed by using conditional compilation to stub out the -wasm code when compiling on other platforms.

If we instead create a separate workspace, this would have the following advantages:

However, the last time I tried to do this, upon running the produced wasm module, I got a runtime error about a memory access out of bounds. This indicates that something is seriously wrong in one of my wasm dependencies or the build process, and ideally it would be fixed whether or not we change the workspace layout. However, this will need effort to minimize the bug.

kpreid commented 9 months ago

The split is done in 06fc0b36558e071bacd38e5a1069b710dc2b8c97 — I have no explanation for why it worked this time and not before, but also no reason to believe that this state is worse than other working states, so I'm going ahead with it. However, some tasks remain: