Skip to content

Commit b998365

Browse files
committed
Support relative readme path on Windows
rust-lang/rust#76586 (comment)
1 parent ae16ecb commit b998365

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/build_options.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -100,18 +100,18 @@ impl Default for BuildOptions {
100100
impl BuildOptions {
101101
/// Tries to fill the missing metadata for a BuildContext by querying cargo and python
102102
pub fn into_build_context(self, release: bool, strip: bool) -> Result<BuildContext> {
103-
let manifest_file = self
104-
.manifest_path
105-
.canonicalize()
106-
.context(format_err!("Can't find {}", self.manifest_path.display()))?;
103+
let manifest_file = &self.manifest_path;
104+
if !manifest_file.exists() {
105+
bail!("Can't find {}", self.manifest_path.display(),);
106+
}
107107

108108
if !manifest_file.is_file() {
109109
bail!(
110110
"{} (resolved to {}) is not the path to a Cargo.toml",
111111
self.manifest_path.display(),
112112
manifest_file.display()
113113
);
114-
};
114+
}
115115

116116
let cargo_toml = CargoToml::from_path(&manifest_file)?;
117117
let manifest_dir = manifest_file.parent().unwrap();

test-crates/hello-world/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ name = "hello-world"
33
version = "0.1.0"
44
authors = ["konstin <konstin@mailbox.org>"]
55
edition = "2018"
6+
readme = "../../Readme.md"
67

78
[dependencies]

0 commit comments

Comments
 (0)