near / cargo-near

Cargo extension for building Rust smart contracts on NEAR
Apache License 2.0
33 stars 16 forks source link

fix same-file truncation issue #75

Closed miraclx closed 1 year ago

miraclx commented 1 year ago

Apparently, the paths returned from cargo_metadata like Metadata::{target_directory,workspace_root} aren't absolute.

This assumed guarantee causes the logic in util::copy to be invalidated.

Treating the same file as if it were different, because one of the paths had ../.. in it.

This patch migrates to early canonization, to avoid this error coming up again.

Props to @itegulov, for discovering this. We should probably cover this in tests.

miraclx commented 1 year ago

Once merged, #76 fixes the CI issue here.