Skip to content

Expose synchronous WASIp2 linker registration - #292

Draft
JDLondon7 wants to merge 1 commit into
bytecodealliance:mainfrom
JDLondon7:tradepit/upstream/w010-wasip2-linker
Draft

Expose synchronous WASIp2 linker registration#292
JDLondon7 wants to merge 1 commit into
bytecodealliance:mainfrom
JDLondon7:tradepit/upstream/w010-wasip2-linker

Conversation

@JDLondon7

Copy link
Copy Markdown

Failing test

upstream/main has no Go binding for wasmtime_component_linker_add_wasip2, so a Go embedder cannot register Wasmtime's synchronous WASIp2 interfaces on a component linker.

General correction

Add ComponentLinker.AddWASIP2, propagate the C API error through the existing Go error wrapper, and keep the linker alive across the cgo call.

This independent M2 slice tracks #280.

Validation

With the v47.0.0 release artifacts restored as ignored build inputs:

go test -tags wasmtime_component_model ./...
golangci-lint run --build-tags wasmtime_component_model --new-from-rev upstream/main --whole-files

Both commands pass on Windows amd64; lint reports 0 issues.

Compatibility and security impact

The API is additive and exposes only the synchronous WASIp2 registration already provided by the Wasmtime C API. Capability configuration remains the embedder's responsibility.

Documentation

The public method includes Go documentation and a focused registration test.

Downstream removal condition

Downstream users can remove equivalent local bindings after an upstream release exposes synchronous WASIp2 linker registration and their WASIp2 fixtures pass unchanged.

This change contains no TradePit product concepts or private data.

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.

1 participant