Skip to content

fix: provide host function stubs for ABI generation#406

Draft
r-near wants to merge 1 commit intomainfrom
fix/abi-host-stubs-317
Draft

fix: provide host function stubs for ABI generation#406
r-near wants to merge 1 commit intomainfrom
fix/abi-host-stubs-317

Conversation

@r-near
Copy link
Copy Markdown
Contributor

@r-near r-near commented Mar 13, 2026

Summary

  • Adds stub implementations of NEAR host functions so the native dylib linker step succeeds during ABI generation
  • Fixes the case where contracts using the sys crate for direct host API access (e.g. no_mangle extern functions) cause link failures with undefined symbols like _attached_deposit, _storage_read, etc.
  • Uses RTLD_GLOBAL stubs + macOS linker flags approach (WIP — to be reworked with cargo rustc approach)

Closes #317

Test plan

  • Verify ABI generation works for contracts using direct sys crate host API access
  • Test against house-of-stake-contracts repro case from the issue
  • Confirm no regressions on standard contract ABI generation

RTLD_GLOBAL stubs + macOS linker flags approach from Codex.
To be reworked with cargo rustc approach.
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.

[Bug] ABI generation fails

1 participant