Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wasm workspace separation #410

Open
kpreid opened this issue Oct 5, 2023 · 1 comment
Open

Wasm workspace separation #410

kpreid opened this issue Oct 5, 2023 · 1 comment
Labels
area: build kind: feature Adding user-facing/developer-facing functionality

Comments

@kpreid
Copy link
Owner

kpreid commented Oct 5, 2023

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:

  • Each workspace can be fully built for its supported platforms, without careful special case commands and cfgs
  • all-is-cubes-server can invoke wasm-pack build from its build script, solving the dependency currently handled messily by xtask (see Make server → wasm dependency optional #270)
  • The wasm build won't have any superfluous feature-unification with the other builds

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 kpreid added kind: bug Something isn't working as it should kind: feature Adding user-facing/developer-facing functionality status: needs reduction Needs creation of a minimal reproduction case. labels Oct 5, 2023
@kpreid kpreid changed the title Wasm build separation Wasm workspace separation Oct 7, 2023
@kpreid
Copy link
Owner Author

kpreid commented Nov 27, 2023

The split is done in 06fc0b3 — 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:

  • Take advantage of building the wasm as an all-is-cubes-server build dependency, as mentioned above.
  • Expand the xtask --scope parameter to allow building only wasm or only not wasm as desired.
  • Remove now-unnecessary special args and cases in xtask.

@kpreid kpreid removed kind: bug Something isn't working as it should status: needs reduction Needs creation of a minimal reproduction case. labels Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: build kind: feature Adding user-facing/developer-facing functionality
Projects
None yet
Development

No branches or pull requests

1 participant