Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't canonicalize paths fed to cargo metadata #282

Merged
merged 1 commit into from
Sep 16, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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