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

abi: dynamically load the dylib at runtime #35

Merged
merged 1 commit into from
Aug 29, 2022
Merged

Conversation

miraclx
Copy link
Contributor

@miraclx miraclx commented Aug 26, 2022

Based off #23

Instead of building an intermediate project that loads the dylib to extract data, we can dynamically load the dylib at runtime from inside cargo-near itself.

#31 (comment)

Copy link
Contributor

@itegulov itegulov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, I was unaware that it was this easy to load and call a dylib in runtime!

This change has one unintended side-effect though: we no longer create target/near directory automatically, so writing ABI to target/near/abi.json can fail if the directory is missing. Try running cargo clean && cargo near build --out-dir res --release --embed-abi on the abi example from SDK repo to see what I mean.

@miraclx
Copy link
Contributor Author

miraclx commented Aug 29, 2022

That is correct, nice catch!

Base automatically changed from miraclx/abi-embed to main August 29, 2022 09:36
@miraclx miraclx merged commit 899cc3e into main Aug 29, 2022
@miraclx miraclx deleted the miraclx/inspect branch August 29, 2022 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants