Skip to content

Build the deny adapter without WASI std - #3723

Merged
fibonacci1729 merged 4 commits into
mainfrom
deny-adapter-build
Sep 24, 2026
Merged

fibonacci1729 merged 4 commits into
mainfrom
deny-adapter-build

Conversation

@fibonacci1729

Copy link
Copy Markdown
Contributor

Builds the deny adapter without WASI std, and add a test that its imports don't overlap its exports

The deny adapter was built for wasm32-wasip2, so Rust's std added its own WASI imports to it. What those imports are depends on the toolchain. With Rust 1.98 they include wasi:sockets/udp@0.2.9 and wasi:sockets/tcp@0.2.9, while the adapter exports wasi:sockets/udp@0.2.6 and udp-create-socket@0.2.6.

Because 0.2.6 and 0.2.9 are semver-compatible, the linker resolves the exported udp-create-socket's use udp.{udp-socket} to the imported 0.2.9 resource instead of the adapter's own exported one. Applying the adapter to a component that imports sockets then produces an invalid component:

type mismatch for import `wasi:sockets/udp-create-socket@0.2.9`
type mismatch in instance export `udp-socket`
resource types are not the same

wac's subtype check compares resources by name only, so the problem only shows up when the composed component is validated. The committed adapter works only because it was built with an older toolchain, so running make adapter on current stable produces a broken adapter.

Signed-off-by: Brian Hardock <brian.hardock@fermyon.com>

@itowlson itowlson 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.

Oof, good find. A couple of suggestions and requests, but nothing blocking.

Comment thread crates/capabilities/src/deny.rs Resolved
Comment thread crates/capabilities/src/deny.rs Resolved
Comment thread crates/capabilities/Makefile Resolved
Signed-off-by: Brian Hardock <brian.hardock@fermyon.com>
Signed-off-by: Brian Hardock <brian.hardock@fermyon.com>
@fibonacci1729

Copy link
Copy Markdown
Contributor Author

The last commit here contains a CI check to ensure the adapter is up-to-date. Neat that it caught an actual problem immediately (the original commited adapter in this PR contained changes from Karthiks PR when i helped debug).

Comment thread .github/workflows/deny-adapter.yml Resolved
Comment thread crates/capabilities/Makefile Resolved
Comment thread crates/capabilities/Makefile Resolved
Signed-off-by: Brian Hardock <brian.hardock@fermyon.com>
@fibonacci1729
fibonacci1729 enabled auto-merge (squash) September 24, 2026 19:52
@fibonacci1729
fibonacci1729 merged commit 3de3a9d into main Sep 24, 2026
18 checks passed
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.

3 participants