Skip to content

V8 module host #2839

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

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 20 # on a successful run, runs in 8 minutes
container:
image: rust:1.83.0
image: rust:1.87.0
options: --privileged
# filter for a comment containing 'benchmarks please'
if: ${{ github.event_name != 'issue_comment' || (github.event.issue.pull_request && contains(github.event.comment.body, 'benchmarks please')) }}
Expand Down
11 changes: 11 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"tabWidth": 4,
"useTabs": false,
"semi": true,
"singleQuote": true,
"arrowParens": "avoid",
"jsxSingleQuote": false,
"trailingComma": "es5",
"endOfLine": "auto",
"printWidth": 100
}
133 changes: 132 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ debug = true
version = "1.2.0"
edition = "2021"
# update rust-toolchain.toml too!
rust-version = "1.84.0"
rust-version = "1.87.0"

[workspace.dependencies]
spacetimedb = { path = "crates/bindings", version = "1.2.0" }
Expand Down Expand Up @@ -258,7 +258,6 @@ termcolor = "1.2.0"
thin-vec = "0.2.13"
thiserror = "1.0.37"
tokio = { version = "1.37", features = ["full"] }
tokio_metrics = { version = "0.4.0" }
tokio-postgres = { version = "0.7.8", features = ["with-chrono-0_4"] }
tokio-stream = "0.1.17"
tokio-tungstenite = { version = "0.26.2", features = ["native-tls"] }
Expand Down Expand Up @@ -322,3 +321,10 @@ features = [
"broadcast",
"ondemand",
]

[workspace.lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tokio_unstable)'] }

[workspace.lints.clippy]
# FIXME: we should work on this lint incrementally
result_large_err = "allow"
3 changes: 3 additions & 0 deletions crates/auth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ jsonwebtoken.workspace = true

[dev-dependencies]
serde_json.workspace = true

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/bench/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,6 @@ tikv-jemalloc-ctl = { workspace = true }
iai-callgrind = { git = "https://github.com/clockworklabs/iai-callgrind.git", branch = "main" }
iai-callgrind-runner = { git = "https://github.com/clockworklabs/iai-callgrind.git", branch = "main" }
iai-callgrind-macros = { git = "https://github.com/clockworklabs/iai-callgrind.git", branch = "main" }

[lints]
workspace = true
2 changes: 1 addition & 1 deletion crates/bench/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# See the README for commands to run.

# sync with: ../../rust-toolchain.toml
FROM rust:1.84.0
FROM rust:1.87.0

RUN apt-get update && \
apt-get install -y valgrind bash && \
Expand Down
3 changes: 3 additions & 0 deletions crates/bindings-macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ proc-macro2.workspace = true
quote.workspace = true
syn.workspace = true
heck.workspace = true

[lints]
workspace = true
13 changes: 12 additions & 1 deletion crates/bindings-macro/src/sats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ pub(crate) fn derive_deserialize(ty: &SatsType<'_>) -> TokenStream {
de_generics.params.insert(0, de_lt_param.into());
let (de_impl_generics, _, de_where_clause) = de_generics.split_for_impl();

let (iter_n, iter_n2, iter_n3) = (0usize.., 0usize.., 0usize..);
let (iter_n, iter_n2, iter_n3, iter_n4) = (0usize.., 0usize.., 0usize.., 0usize..);

match &ty.data {
SatsTypeData::Product(fields) => {
Expand Down Expand Up @@ -447,12 +447,23 @@ pub(crate) fn derive_deserialize(ty: &SatsType<'_>) -> TokenStream {
names.extend::<&[&str]>(&[#(#field_strings),*])
}

fn nth_name(&self, i: usize) -> Option<&str> {
[#(#field_strings),*].get(i).copied()
}

fn visit<__E: #spacetimedb_lib::de::Error>(self, name: &str) -> Result<Self::Output, __E> {
match name {
#(#field_strings => Ok(__ProductFieldIdent::#field_names),)*
_ => Err(#spacetimedb_lib::de::Error::unknown_field_name(name, &self)),
}
}

fn visit_seq<__E: #spacetimedb_lib::de::Error>(self, i: usize) -> Result<Self::Output, __E> {
match i {
#(#iter_n4 => Ok(__ProductFieldIdent::#field_names),)*
_ => Err(#spacetimedb_lib::de::Error::invalid_product_length(i.saturating_add(1), &self)),
}
}
}

#[allow(non_camel_case_types)]
Expand Down
3 changes: 3 additions & 0 deletions crates/bindings-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ unstable = []

[dependencies]
spacetimedb-primitives.workspace = true

[lints]
workspace = true
Loading