Open aewc opened 1 year ago
ah this is a mac symlink issue
path paths point to the same file, but the way std::fs::canonicalize
works on mac is that /private/var/
is resolved to /var
, or the other way around, can't remember.
this could be fixed by used std::fs::canonicalize
on the other variant in the assertEq I think.
Could you please try that?
Yes, macOS have this weird linked dir: std::fs::canonicalize
would add /private
in /var
However, it has not been resolved. The root cause is that the build-info
folder has not been created, resulting in
pub fn canonicalized(path: impl Into<PathBuf>) -> PathBuf {
let path = path.into();
canonicalize(&path).unwrap_or(path)
}
unwrap_or
directly returns path
.
I printed some information, as follows:
Ok("/private/var/folders/2y/70kmz0xn3j95ncb5fw0j737w0000gn/T/root9n6PoM")
Ok("/private/var/folders/2y/70kmz0xn3j95ncb5fw0j737w0000gn/T/root9n6PoM/contracts")
Ok("/private/var/folders/2y/70kmz0xn3j95ncb5fw0j737w0000gn/T/root9n6PoM/src")
Ok("/private/var/folders/2y/70kmz0xn3j95ncb5fw0j737w0000gn/T/root9n6PoM/artifacts")
Err(SolcIoError { io: Os { code: 20, kind: NotADirectory, message: "Not a directory" }, path: "/var/folders/2y/70kmz0xn3j95ncb5fw0j737w0000gn/T/root9n6PoM/artifacts/build-info" })
The build_infos
is newed by artifacts.join("build-info")
, while others are newed by root.path().join()
, this may cause build-info not creating:
fn can_autodetect_dirs() {
let root = utils::tempdir("root").unwrap();
let out = root.path().join("out");
let artifacts = root.path().join("artifacts");
let build_infos = artifacts.join("build-info");
let contracts = root.path().join("contracts");
let src = root.path().join("src");
let lib = root.path().join("lib");
let node_modules = root.path().join("node_modules");
...
Version I pull the ethers-rs, and using the Commit b0ef1343dd71c28bdce74212aa136e827b9c54a8.
Platform
Darwin C27C.local 22.1.0 Darwin Kernel Version 22.1.0: Sun Oct 9 20:14:30 PDT 2022; root:xnu-8792.41.9~2/RELEASE_ARM64_T8103 arm64
Description
The path difference in
tests::can_autodetect_dirs
is only/private