Skip to content

Fix a couple of bugs in the guest component bindgen - #1732

Merged
syntactically merged 2 commits into
mainfrom
lm/component-guest-fixes
Aug 13, 2026
Merged

Fix a couple of bugs in the guest component bindgen#1732
syntactically merged 2 commits into
mainfrom
lm/component-guest-fixes

Conversation

@syntactically

Copy link
Copy Markdown
Member

No description provided.

Copilot AI lite review requested due to automatic review settings August 13, 2026 08:58
@syntactically
syntactically force-pushed the lm/component-guest-fixes branch from d8f899f to bd7f3bc Compare August 13, 2026 08:58
@syntactically syntactically added the kind/bugfix For PRs that fix bugs label Aug 13, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the Rust guest-side component binding generator to correct trait context handling during export emission and refine how imported resource types are recognized/emitted.

Changes:

  • Adjusts guest bindgen logic for imported Type externs to key off SubResource and derive HostResource* identifiers from the bound-var index.
  • Ensures cur_trait is set to the export trait before emitting/registering top-level exports.
  • Cleans up imports in guest.rs (drops ResolvedBoundVar).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/hyperlight_component_util/src/guest.rs
Previously, the guest bindgen would emit an impl for a resource trait
whenever it encountered an exported type _that resolved to_e a resource
type. Unfortunately, this was incorrect: a tyvar that is bounded to be
equal to a resource type should not generate a new impl of its own,
since there is no trait for it.

Signed-off-by: Lucy Menon <168595099+syntactically@users.noreply.github.com>
Previously, functions directly exported by a component, without an
intervening instance, would not have had their bindings generated
correctly: the bindings would have referred to a non-existent imported
version of the function, since `State::cur_trait` was not set
properly.

Signed-off-by: Lucy Menon <168595099+syntactically@users.noreply.github.com>
@syntactically
syntactically force-pushed the lm/component-guest-fixes branch from bd7f3bc to 2e72ca6 Compare August 13, 2026 10:47
@syntactically syntactically added the ready-for-review PR is ready for (re-)review label Aug 13, 2026
Base automatically changed from lm/component-test-qol to main August 13, 2026 11:52
@syntactically
syntactically merged commit 2e72ca6 into main Aug 13, 2026
59 of 64 checks passed
@syntactically
syntactically deleted the lm/component-guest-fixes branch August 13, 2026 17:47
@github-actions github-actions Bot removed the ready-for-review PR is ready for (re-)review label Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bugfix For PRs that fix bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants