Skip to content
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
3 changes: 2 additions & 1 deletion .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ jobs:
runs-on: spacetimedb-linux
timeout-minutes: 20 # on a successful run, runs in 8 minutes
container:
image: rust:1.93.0
# !rust-toolchain-sync
image: rust:1.98.1
options: --privileged
# disable until we fix the benchmarks
if: false
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ debug = true
version = "2.10.1"
edition = "2024"
# update rust-toolchain.toml too!
rust-version = "1.93.0"
rust-version = "1.98.1"

[workspace.dependencies]
spacetimedb = { path = "crates/bindings", version = "=2.10.1" }
Expand Down
4 changes: 2 additions & 2 deletions crates/bench/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# Set up to run from linux / WSL (running from a windows file system will be extremely slow).
# See the README for commands to run.

# sync with: ../../rust-toolchain.toml
FROM rust:1.93.0
# !rust-toolchain-sync
FROM rust:1.98.1

RUN apt-get update && \
apt-get install -y valgrind bash && \
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/src/subcommands/dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1270,7 +1270,7 @@ async fn select_database(config: &Config, server: &str, token: &str) -> Result<S
// Fetch database names with HTTP queries to /database/{identity}/names
// It's parallelyzed in case a user has a lot of databases
// TODO: we should introduce an endpoint that returns user's databases with names
let databases: Vec<DatabaseRow> = stream::iter(result.identities.into_iter())
let databases: Vec<DatabaseRow> = stream::iter(result.identities)
.map(|identity_str| {
let config = config.clone();
async move {
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/src/subcommands/repl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub(crate) async fn exec(con: Connection, format: Format) -> Result<(), anyhow::
let api = ClientApi::new(con);

loop {
let readline = rl.readline(&format!("🪐{}>", &database).green());
let readline = rl.readline(&format!("🪐{}>", database).green());
match readline {
Ok(line) => match line.as_str() {
".exit" => break,
Expand Down
2 changes: 1 addition & 1 deletion crates/codegen/src/unrealcpp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ impl Lang for UnrealCpp<'_> {
let name = type_ref_name(self.module_prefix, module, typ.ty);
let filename = format!(
"Source/{}/Public/ModuleBindings/Types/{}Type.g.h",
self.module_name, &name
self.module_name, name
);
let code: String = match &module.typespace_for_generate()[typ.ty] {
AlgebraicTypeDef::PlainEnum(plain_enum) => autogen_cpp_enum(&name, plain_enum),
Expand Down
2 changes: 1 addition & 1 deletion crates/commitlog/src/segment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use crate::{
Options,
};

pub const MAGIC: [u8; 6] = [b'(', b'd', b's', b')', b'^', b'2'];
pub const MAGIC: [u8; 6] = *b"(ds)^2";

pub const DEFAULT_LOG_FORMAT_VERSION: u8 = 1;
pub const DEFAULT_CHECKSUM_ALGORITHM: u8 = CHECKSUM_ALGORITHM_CRC32C;
Expand Down
2 changes: 1 addition & 1 deletion crates/core/src/host/instance_env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ impl InstanceEnv {
/// End a console timer by logging the span at INFO level.
pub(crate) fn console_timer_end(&self, span: &TimingSpan, function: Option<&str>) {
let elapsed = span.start.elapsed();
let message = format!("Timing span {:?}: {:?}", &span.name, elapsed);
let message = format!("Timing span {:?}: {:?}", span.name, elapsed);

self.console_log_simple_message(LogLevel::Info, function, &message);
}
Expand Down
2 changes: 1 addition & 1 deletion crates/core/src/host/v8/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ impl fmt::Display for JsStackTraceFrame {
// TODO(v8): make it more like chrome in the future.
f.write_fmt(format_args!(
"at {} ({}:{}:{})",
fn_name, script_name, &self.line, &self.column
fn_name, script_name, self.line, self.column
))?;

if self.is_ctor {
Expand Down
5 changes: 2 additions & 3 deletions crates/datastore/src/locking_tx_datastore/datastore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,8 @@ impl Locking {
/// error.
pub fn take_snapshot(&self, repo: &DynSnapshotRepo) -> Result<Option<TxOffset>> {
Self::take_snapshot_internal(&self.committed_state, repo)?
.map(|(_offset, snap)| snap.sync_all())
.map(|(_offset, snap)| snap.sync_all().map_err(Into::into))
.transpose()
.map_err(Into::into)
}

pub fn assert_system_tables_match(&self) -> Result<()> {
Expand Down Expand Up @@ -3014,7 +3013,7 @@ pub(crate) mod tests {

fn assert_rows(datastore: &Locking, table_id: TableId, rows: Vec<ProductValue>) -> ResultTest<()> {
let tx = begin_tx(datastore);
for (actual, expected) in datastore.iter_tx(&tx, table_id)?.zip_eq(rows.into_iter()) {
for (actual, expected) in datastore.iter_tx(&tx, table_id)?.zip_eq(rows) {
assert_eq!(actual.to_bsatn_vec()?, expected.to_bsatn_vec()?);
}
Ok(())
Expand Down
8 changes: 4 additions & 4 deletions crates/dst/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -456,12 +456,12 @@ mod tests {
}],
};

let raw = to_raw_def(&schema);
let raw = to_raw_def(&schema).into_sections();

// Should have Typespace, Types, and Tables sections.
assert!(raw.typespace().is_some());
assert!(raw.types().is_some());
let tables = raw.tables().unwrap();
assert!(raw.typespace.is_some());
assert!(raw.types.is_some());
let tables = raw.tables.unwrap();
assert_eq!(tables.len(), 1);

let t = &tables[0];
Expand Down
11 changes: 4 additions & 7 deletions crates/engine/src/relational_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -627,13 +627,10 @@ impl RelationalDB {
// Try to restore from any snapshot that was taken within the
// range `(min_commitlog_offset + 1)..=durable_tx_offset`.
let mut upper_bound = durable_tx_offset;
loop {
let Some(snapshot_offset) = snapshot_repo
.latest_snapshot_older_than(upper_bound)
.map_err(Box::new)?
else {
break;
};
while let Some(snapshot_offset) = snapshot_repo
.latest_snapshot_older_than(upper_bound)
.map_err(Box::new)?
{
if min_commitlog_offset > 0 && min_commitlog_offset > snapshot_offset + 1 {
log::debug!("snapshot_offset={snapshot_offset} min_commitlog_offset={min_commitlog_offset}");
break;
Expand Down
4 changes: 2 additions & 2 deletions crates/engine/src/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ pub fn create_table_from_view_def(
view_def: &ViewDef,
) -> anyhow::Result<()> {
stdb.create_view(tx, module_def, view_def)
.with_context(|| format!("failed to create table for view {}", &view_def.name))?;
.with_context(|| format!("failed to create table for view {}", view_def.name))?;
Ok(())
}

Expand All @@ -719,7 +719,7 @@ pub fn create_table_from_view_def_with_prefix(
name_prefix: &NamespacePath,
) -> anyhow::Result<()> {
stdb.create_view_with_prefix(tx, owning_def, view_def, name_prefix)
.with_context(|| format!("failed to create table for view {}{}", name_prefix, &view_def.name))?;
.with_context(|| format!("failed to create table for view {}{}", name_prefix, view_def.name))?;
Ok(())
}

Expand Down
1 change: 1 addition & 0 deletions crates/lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ hex.workspace = true
serde = { workspace = true, optional = true }
blake3.workspace = true
enum-map = { workspace = true, optional = true }
paste.workspace = true

# For the 'proptest' feature.
proptest = { workspace = true, optional = true }
Expand Down
Loading