SpacetimeDB icon indicating copy to clipboard operation
SpacetimeDB copied to clipboard

Remove spacetimedb-core as a dep of cli

Open coolreader18 opened this issue 10 months ago • 4 comments

Description of Changes

This is possible now that standalone is now a separate binary from cli. This lets us separate concerns, and speed up compilation of the cli.

Expected complexity level and risk

1 - moves some stuff around but otherwise a pretty small change.

Testing

  • [x] No functionality change, tests still pass for codegen for our test modules (for rust, csharp modules).

coolreader18 avatar Feb 11 '25 03:02 coolreader18

I'm broadly in favor of improving compile times. +1 to Mario's questions.

Dumb question - what exactly is spacetimedb-core? At first glance, it seems entirely reasonable for the CLI to depend on a core spacetimedb library.

I don't personally feel equipped to confirm that the changes don't do something meaningful, particularly around wasmtime. Can you add a bit more detail to the Testing section about the existing test coverage for generate?

bfops avatar Mar 07 '25 17:03 bfops

spacetimedb-core is the core of the database implementation, and now that is being pulled in by standalone. The CLI only needs to be able to talk to a database, but it doesn't need to run one itself.

coolreader18 avatar Mar 07 '25 18:03 coolreader18

I could copy over Mem and MemView from spacetimedb_core::host::wasmtime, but that would mean there's more code and unsafe duplicated overall, and this only uses a small amount of its functionality.

coolreader18 avatar Mar 07 '25 18:03 coolreader18

The internal tests are only because Cargo.lock needs regen. I feel like those tests probably shouldn't use --locked

coolreader18 avatar Mar 07 '25 19:03 coolreader18