From 1e6d8d2bebd2a2e8aabee29be5bedf045e906025 Mon Sep 17 00:00:00 2001 From: messense Date: Wed, 1 Nov 2023 22:46:43 +0800 Subject: [PATCH] Try to fix windows test failure --- Cargo.lock | 1 + Cargo.toml | 1 + src/source_distribution.rs | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index fb66e5eaa..5aaf59dcc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1090,6 +1090,7 @@ dependencies = [ "native-tls", "normpath", "once_cell", + "path-slash", "pep440_rs", "pep508_rs", "platform-info", diff --git a/Cargo.toml b/Cargo.toml index 6bac735fc..280efb7bc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -71,6 +71,7 @@ lddtree = "0.3.3" cc = "1.0.72" dunce = "1.0.2" normpath = "1.0.0" +path-slash = "0.2.1" pep440_rs = { version = "0.3.6", features = ["serde"] } pep508_rs = { version = "0.2.1", features = ["serde"] } time = "0.3.17" diff --git a/src/source_distribution.rs b/src/source_distribution.rs index 230d13948..fe7022329 100644 --- a/src/source_distribution.rs +++ b/src/source_distribution.rs @@ -6,6 +6,7 @@ use cargo_metadata::{Metadata, MetadataCommand}; use fs_err as fs; use ignore::overrides::Override; use normpath::PathExt as _; +use path_slash::PathExt as _; use std::collections::HashMap; use std::path::{Path, PathBuf}; use std::process::Command; @@ -458,7 +459,7 @@ fn add_cargo_package_files_to_sdist( let main_member_name = abs_manifest_dir .strip_prefix(workspace_root) .unwrap() - .to_str() + .to_slash() .unwrap() .to_string(); deps_to_keep.insert(