Skip to content

Commit 5e736a1

Browse files
committed
Fix compile errors and warnings on Windows
The resolve_test tests failed to compile locally, not sure why this isn't happening in CI. Signed-off-by: J Robert Ray <[email protected]>
1 parent 60a17a7 commit 5e736a1

File tree

5 files changed

+21
-5
lines changed

5 files changed

+21
-5
lines changed

crates/spfs/src/repeating_timeout.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ use core::task::{Context, Poll};
1212
use std::fmt;
1313
use std::time::Duration;
1414

15+
#[cfg(unix)]
16+
use futures::StreamExt;
1517
use futures::stream::Fuse;
16-
use futures::{Future, Stream, StreamExt, ready};
18+
use futures::{Future, Stream, ready};
1719
use pin_project_lite::pin_project;
1820
use tokio::time::{Instant, Sleep};
1921

crates/spfs/src/resolve.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,27 @@
22
// SPDX-License-Identifier: Apache-2.0
33
// https://github.com/spkenv/spk
44

5+
#[cfg(unix)]
56
use std::collections::HashSet;
67
use std::path::{Path, PathBuf};
78

89
use futures::{FutureExt, TryFutureExt, TryStreamExt};
910
use itertools::Itertools;
11+
#[cfg(unix)]
1012
use nonempty::NonEmpty;
1113
use serde::{Deserialize, Serialize};
1214

1315
use super::config::get_config;
16+
#[cfg(unix)]
1417
use crate::config::OverlayFsOptions;
1518
use crate::prelude::*;
19+
#[cfg(unix)]
20+
use crate::runtime;
21+
#[cfg(unix)]
1622
use crate::storage::fallback::FallbackProxy;
23+
#[cfg(unix)]
1724
use crate::storage::fs::{CliRenderType, ManifestRenderPath, RenderSummary};
18-
use crate::{Error, Result, graph, runtime, storage, tracking};
25+
use crate::{Error, Result, graph, storage, tracking};
1926

2027
#[cfg(test)]
2128
#[path = "./resolve_test.rs"]

crates/spfs/src/resolve_test.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,19 @@
22
// SPDX-License-Identifier: Apache-2.0
33
// https://github.com/spkenv/spk
44

5+
#[cfg(unix)]
56
use std::sync::Arc;
67

78
use rstest::rstest;
89

910
use super::resolve_stack_to_layers;
1011
use crate::fixtures::*;
12+
#[cfg(unix)]
13+
use crate::io;
14+
#[cfg(unix)]
1115
use crate::io::DigestFormat;
1216
use crate::prelude::*;
13-
use crate::{encoding, graph, io};
17+
use crate::{encoding, graph};
1418

1519
#[rstest]
1620
#[tokio::test]
@@ -26,6 +30,8 @@ async fn test_stack_to_layers_dedupe(#[future] tmprepo: TempRepo) {
2630
assert_eq!(resolved.len(), 1, "should deduplicate layers in resolve");
2731
}
2832

33+
// `resolve_overlay_dirs` only exists on unix
34+
#[cfg(unix)]
2935
/// Test that if there are too many layers to fit on a single mount
3036
/// that enough layers are merged together so the mount will succeed.
3137
#[rstest]
@@ -81,6 +87,8 @@ async fn test_auto_merge_layers(tmpdir: tempfile::TempDir) {
8187
);
8288
}
8389

90+
// `resolve_overlay_dirs` only exists on unix
91+
#[cfg(unix)]
8492
/// Test that if there are too many layers to fit on a single mount
8593
/// and the topmost layer contains an edit of the next top most layer
8694
/// that after merging layers the edit remains in the merged layer

crates/spfs/src/runtime/startup_ps.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// SPDX-License-Identifier: Apache-2.0
33
// https://github.com/spkenv/spk
44

5-
use itertools::Itertools;
6-
75
use super::EnvKeyValue;
86

97
pub fn source(_environment_overrides: &[EnvKeyValue]) -> String {

crates/spk-cli/common/src/flags.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ use spk_schema::ident::{
3838
};
3939
use spk_schema::option_map::HOST_OPTIONS;
4040
use spk_schema::{Recipe, SpecFileData, SpecRecipe, Template, TestStage, VariantExt};
41+
#[cfg(unix)]
4142
#[cfg(feature = "statsd")]
4243
use spk_solve::{SPK_RUN_TIME_METRIC, get_metrics_client};
4344
use spk_workspace::{FindOrLoadPackageTemplateError, FindPackageTemplateError};

0 commit comments

Comments
 (0)