Skip to content

Commit

Permalink
Support relative readme path on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Apr 24, 2021
1 parent ae16ecb commit a47303e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/build_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,18 @@ impl Default for BuildOptions {
impl BuildOptions {
/// Tries to fill the missing metadata for a BuildContext by querying cargo and python
pub fn into_build_context(self, release: bool, strip: bool) -> Result<BuildContext> {
let manifest_file = self
.manifest_path
.canonicalize()
.context(format_err!("Can't find {}", self.manifest_path.display()))?;
let manifest_file = &self.manifest_path;
if !manifest_file.exists() {
bail!("Can't find {}", self.manifest_path.display(),);
}

if !manifest_file.is_file() {
bail!(
"{} (resolved to {}) is not the path to a Cargo.toml",
self.manifest_path.display(),
manifest_file.display()
);
};
}

let cargo_toml = CargoToml::from_path(&manifest_file)?;
let manifest_dir = manifest_file.parent().unwrap();
Expand Down
1 change: 1 addition & 0 deletions test-crates/hello-world/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ name = "hello-world"
version = "0.1.0"
authors = ["konstin <[email protected]>"]
edition = "2018"
readme = "../../Readme.md"

[dependencies]
2 changes: 1 addition & 1 deletion test-dockerfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ source venv-docker/bin/activate

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

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

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

Expand Down

0 comments on commit a47303e

Please sign in to comment.