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

Remove spacetimedb-core as a dep of cli #2244

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

coolreader18
Copy link
Collaborator

@coolreader18 coolreader18 commented Feb 11, 2025

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

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

@coolreader18 coolreader18 force-pushed the noa/rm-core-dep-of-cli branch 3 times, most recently from 71f00ed to 93c50bd Compare February 11, 2025 23:25
@bfops bfops added the release-any To be landed in any release window label Feb 18, 2025
@@ -49,39 +47,33 @@ pub struct IncomingClaims {
}

impl TryInto<SpacetimeIdentityClaims> for IncomingClaims {
type Error = TokenValidationError;
type Error = anyhow::Error;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was removed the TokenValidationError?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method never actually returned anything other than its Other(anyhow::Error) variant, so it's easier to just return anyhow::Error.

spacetimedb-client-api-messages.workspace = true
spacetimedb-core.workspace = true
spacetimedb-data-structures.workspace = true
spacetimedb-data-structures = { workspace = true, features = ["serde"] }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is the feature newly needed here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was being enabled by core, but now core isn't in the build graph.

@@ -6,7 +6,7 @@ license-file = "LICENSE"
description = "Assorted data structures used in spacetimedb"

[features]
serde = ["dep:serde"]
serde = ["dep:serde", "hashbrown/serde"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this feature needed now?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same reason - no longer being enabled by some other crate now that core isn't in the build graph.

@bfops
Copy link
Collaborator

bfops commented Mar 7, 2025

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?

@coolreader18
Copy link
Collaborator Author

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 coolreader18 force-pushed the noa/rm-core-dep-of-cli branch from 93c50bd to 9057b09 Compare March 7, 2025 18:45
@coolreader18 coolreader18 requested a review from jdetter as a code owner March 7, 2025 18:45
@coolreader18
Copy link
Collaborator Author

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 coolreader18 force-pushed the noa/rm-core-dep-of-cli branch from 9057b09 to e3f44a0 Compare March 7, 2025 18:50
@coolreader18
Copy link
Collaborator Author

coolreader18 commented Mar 7, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-any To be landed in any release window
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants