Skip to content

Commit

Permalink
Merge pull request #282 from Gankra/canon
Browse files Browse the repository at this point in the history
Don't canonicalize paths fed to `cargo metadata`.

Canonicalizing seems to cause problems for windows builds.
  • Loading branch information
rfk authored Sep 16, 2020
2 parents 5b6369e + 9153db7 commit 7cb8f73
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions uniffi_bindgen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,7 @@ pub fn generate_component_scaffolding<P: AsRef<Path>>(
) -> Result<()> {
let manifest_path_override = manifest_path_override.as_ref().map(|p| p.as_ref());
let out_dir_override = out_dir_override.as_ref().map(|p| p.as_ref());
let idl_file = PathBuf::from(idl_file.as_ref())
.canonicalize()
.map_err(|e| anyhow!("Failed to find idl file: {:?}", e))?;
let idl_file = idl_file.as_ref();
let component = parse_idl(&idl_file)?;
ensure_versions_compatibility(&idl_file, manifest_path_override)?;
let mut filename = Path::new(&idl_file)
Expand Down Expand Up @@ -155,11 +153,7 @@ fn ensure_versions_compatibility(
// If --manifest-path is not provided, we run cargo `metadata` in the .idl dir.
match manifest_path_override {
Some(p) => {
metadata_cmd.manifest_path(
PathBuf::from(p)
.canonicalize()
.map_err(|e| anyhow!("Failed to find Cargo.toml file: {:?}", e))?,
);
metadata_cmd.manifest_path(p);
}
None => {
metadata_cmd.current_dir(idl_file.parent().ok_or_else(|| anyhow!("no parent!"))?);
Expand Down

0 comments on commit 7cb8f73

Please sign in to comment.