Skip to content

Commit a47303e

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

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

src/build_options.rs

Lines changed: 5 additions & 5 deletions
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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ name = "hello-world"
33
version = "0.1.0"
44
authors = ["konstin <[email protected]>"]
55
edition = "2018"
6+
readme = "../../Readme.md"
67

78
[dependencies]

test-dockerfile.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ source venv-docker/bin/activate
1313

1414
venv-docker/bin/pip install -U pip cffi
1515

16-
docker run -e RUST_BACKTRACE=1 --rm -v $(pwd)/test-crates/hello-world:/io maturin build --no-sdist -b bin
16+
docker run -e RUST_BACKTRACE=1 --rm -v $(pwd):/io -w /io/test-crates/hello-world maturin build --no-sdist -b bin
1717

1818
venv-docker/bin/pip install hello-world --no-index --find-links test-crates/hello-world/target/wheels/
1919

0 commit comments

Comments
 (0)