Skip to content

Commit 01a1d0e

Browse files
committed
Fixed compile errors and warnings on Windows
1 parent 65e12b9 commit 01a1d0e

File tree

6 files changed

+14
-10
lines changed

6 files changed

+14
-10
lines changed

crates/bench/benches/generic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use spacetimedb_testing::modules::{Csharp, Rust};
1515

1616
#[cfg(target_env = "msvc")]
1717
#[global_allocator]
18-
static GLOBAL: MiMalloc = MiMalloc;
18+
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
1919

2020
#[cfg(not(target_env = "msvc"))]
2121
use tikv_jemallocator::Jemalloc;

crates/bench/benches/special.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use std::sync::OnceLock;
1414

1515
#[cfg(target_env = "msvc")]
1616
#[global_allocator]
17-
static GLOBAL: MiMalloc = MiMalloc;
17+
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
1818

1919
#[cfg(not(target_env = "msvc"))]
2020
use tikv_jemallocator::Jemalloc;

crates/core/src/db/relational_db.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1741,6 +1741,7 @@ mod tests {
17411741
use spacetimedb_sats::buffer::BufReader;
17421742
use spacetimedb_sats::product;
17431743
use spacetimedb_schema::schema::RowLevelSecuritySchema;
1744+
#[cfg(unix)]
17441745
use spacetimedb_snapshot::Snapshot;
17451746
use spacetimedb_table::read_column::ReadColumn;
17461747
use spacetimedb_table::table::RowRef;
@@ -2710,6 +2711,7 @@ mod tests {
27102711
let (dir, repo) = make_snapshot(root.clone(), Identity::ZERO, 0, CompressType::None, true);
27112712
stdb.take_snapshot(&repo)?;
27122713

2714+
#[cfg(unix)]
27132715
let total_objects = repo.size_on_disk()?.object_count;
27142716
// Another snapshots that will hardlink part of the first one
27152717
for i in 0..2 {

crates/core/src/worker_metrics/mod.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,9 @@ use tikv_jemalloc_ctl::{epoch, stats};
231231

232232
use std::sync::Once;
233233
use tokio::{spawn, time::sleep};
234+
#[cfg(not(target_env = "msvc"))]
234235
static SPAWN_JEMALLOC_GUARD: Once = Once::new();
235-
pub fn spawn_jemalloc_stats(node_id: String) {
236+
pub fn spawn_jemalloc_stats(_node_id: String) {
236237
#[cfg(not(target_env = "msvc"))]
237238
SPAWN_JEMALLOC_GUARD.call_once(|| {
238239
spawn(async move {
@@ -242,17 +243,17 @@ pub fn spawn_jemalloc_stats(node_id: String) {
242243
let allocated = stats::allocated::read().unwrap();
243244
WORKER_METRICS
244245
.jemalloc_allocated_bytes
245-
.with_label_values(&node_id)
246+
.with_label_values(&_node_id)
246247
.set(allocated as i64);
247248
let resident = stats::resident::read().unwrap();
248249
WORKER_METRICS
249250
.jemalloc_resident_bytes
250-
.with_label_values(&node_id)
251+
.with_label_values(&_node_id)
251252
.set(resident as i64);
252253
let active = stats::active::read().unwrap();
253254
WORKER_METRICS
254255
.jemalloc_active_bytes
255-
.with_label_values(&node_id)
256+
.with_label_values(&_node_id)
256257
.set(active as i64);
257258

258259
sleep(Duration::from_secs(10)).await;

crates/paths/src/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -268,13 +268,14 @@ impl SpacetimePaths {
268268

269269
#[cfg(test)]
270270
mod tests {
271-
use std::ffi::{OsStr, OsString};
272271
use std::path::Path;
273272

274273
use super::*;
275274

275+
#[cfg(not(windows))]
276276
mod vars {
277277
use super::*;
278+
use std::ffi::{OsStr, OsString};
278279
struct ResetVar<'a>(&'a str, Option<OsString>);
279280
impl Drop for ResetVar<'_> {
280281
fn drop(&mut self) {

crates/update/src/proxy.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::process::ExitCode;
99

1010
pub(crate) fn run_cli(
1111
paths: Option<&SpacetimePaths>,
12-
argv0: Option<&OsStr>,
12+
_argv0: Option<&OsStr>,
1313
args: Vec<OsString>,
1414
) -> anyhow::Result<ExitCode> {
1515
let parse_args = || PartialCliArgs::parse(&args);
@@ -44,8 +44,8 @@ pub(crate) fn run_cli(
4444
#[cfg(unix)]
4545
{
4646
use std::os::unix::process::CommandExt;
47-
if let Some(argv0) = argv0 {
48-
cmd.arg0(argv0);
47+
if let Some(_argv0) = _argv0 {
48+
cmd.arg0(_argv0);
4949
}
5050
};
5151
let exec_result = exec_replace(&mut cmd).with_context(|| format!("exec failed for {}", cli_path.display()));

0 commit comments

Comments
 (0)