xmtp / didethresolver

XMTP Registry Resolver
MIT License
3 stars 1 forks source link

fix DIDRegistry.json for dependant crates, `lib/abi -> abi` #38

Closed insipx closed 8 months ago

insipx commented 8 months ago

When compiling lib-didethresolver with xps-gateway, the gateway compile is unable to find DIDRegistry.json, but lib-didethresolver still compiles successfully in it's own directory

during compilation, cargo auto-sets the directory to $CARGO_MANIFEST_DIR, which for lib-didethresolver is this:

cat target/debug/build/lib-didethresolver-7a76cec61a699ce9/output 1 │ /Users/insipx/.cargo/git/checkouts/didethresolver-52eccfd11c9d11f4/998b9f5/lib 2 │ /Users/insipx/.cargo/git/checkouts/didethresolver-52eccfd11c9d11f4/998b9f5/lib/lib/abi/DIDRegistry.json

when compiling on its own, CARGO_MANIFEST_DIR is probably set to the virtual manifest rather than the one in lib, causing this error

debugged using this build.rs

fn main() {
    let manifest_dir = env!("CARGO_MANIFEST_DIR");
    println!("{}", manifest_dir);
    println!("{}/lib/abi/DIDRegistry.json", manifest_dir);
}

we were adding an extra lib, this pr solves the issue and enables a successful compile for both crates

codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (998b9f5) 95.81% compared to head (a5e2507) 95.81%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #38 +/- ## ======================================= Coverage 95.81% 95.81% ======================================= Files 13 13 Lines 2153 2153 ======================================= Hits 2063 2063 Misses 90 90 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.