Repository navigation
Remove the WASM function runtime - #4885
Adham-Kiwan wants to merge 3 commits into
Conversation
✅ Deploy Preview for kptdocs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the change removing WASM function execution.
No open issues 🎉
What changed in this PR
Removes WASM function execution from kpt for #4882, while retaining API stubs and CLI flags that report the feature’s removal. OCI push/pull helpers remain unchanged; documentation updates are deferred to #4883.
Changes:
- Removes the Wasmtime and Node.js runtimes, JavaScript glue, and root-module runtime dependencies.
- Makes
NewWasmFnandWasmFn.RunreturnErrWasmFunctionsRemovedand updates CLI flag help. - Updates end-to-end tests to expect failure and removes obsolete runtime setup.
| File | Description |
|---|---|
pkg/fn/runtime/wasmtime.go |
Deletes the Wasmtime runtime implementation. |
pkg/fn/runtime/wasmtime_unsupported.go |
Deletes the non-CGO Wasmtime fallback. |
pkg/fn/runtime/wasm.go |
Adds removal-error stubs while retaining loaders. |
pkg/fn/runtime/nodejs.go |
Deletes the Node.js WASM runtime. |
pkg/fn/runtime/jsglue.go |
Deletes JavaScript runtime glue. |
make/info.mk |
Removes the default WASM runtime environment setting. |
go.sum |
Removes checksums for the deleted runtime dependencies. |
go.mod |
Removes wasmtime-go and wasmexec dependencies. |
e2e/testdata/fn-render/basicpipeline-wasm/.expected/teardown.sh |
Removes obsolete environment cleanup. |
e2e/testdata/fn-render/basicpipeline-wasm/.expected/setup.sh |
Removes obsolete Node.js runtime selection. |
e2e/testdata/fn-render/basicpipeline-wasm/.expected/diff.patch |
Expects failed render status instead of resource mutations. |
e2e/testdata/fn-render/basicpipeline-wasm/.expected/config.yaml |
Expects a nonzero exit and the removal message. |
e2e/testdata/fn-eval/wasm-function/.expected/diff.patch |
Removes the expected successful resource mutation. |
e2e/testdata/fn-eval/wasm-function/.expected/config.yaml |
Expects a nonzero exit and the removal message. |
cli/fn/render/cmdrender.go |
Updates retained WASM flag help for render failures. |
cli/fn/cmdeval/cmdeval.go |
Updates retained WASM flag help for eval failures. |
Review effort: Balanced
Remove the wasmtime and Node.js based WASM runtimes together with the wasmtime-go and wasmexec dependencies, as agreed in kptdev#4881. NewWasmFn and WasmFn.Run are kept as stubs that return ErrWasmFunctionsRemoved, so running a function with --allow-alpha-wasm now fails with an error that says the feature was removed. The WASM loaders are left in place in case WASM support is revisited. The WASM e2e test cases now check for that error, and the KPT_FN_WASM_RUNTIME default is dropped from the Makefile. Fixes kptdev#4882 Assisted-by: Claude Code (claude-opus-5-5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Adham Kiwan <adhamkiwan@outlook.com>
Since kptdev#4829, pkg/lib/krmvalidate uses kptfilev1.IsKustomization, which no released github.com/kptdev/kpt/api version has yet, so the root and cli modules no longer build from their go.mod alone. Enable the replace directives the go.mod files keep for this case until the next API release, and tidy both modules, which also drops the WASM runtime dependencies from cli/go.mod. Assisted-by: Claude Code (claude-opus-5-5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Adham Kiwan <adhamkiwan@outlook.com>
Keep the original flag descriptions and mark the flag deprecated on fn eval and fn render, with "support for WASM functions has been removed from kpt" as the deprecation message. Cobra prints that message when the flag is used and hides the flag from the help output. Assisted-by: Claude Code (claude-opus-5-5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Adham Kiwan <adhamkiwan@outlook.com>
f6a4eda to
482d6dd
Compare
|
| // replace github.com/kptdev/kpt => .. | ||
| replace github.com/kptdev/kpt/api => ../api | ||
|
|
||
| replace github.com/kptdev/kpt => .. |
There was a problem hiding this comment.
I think we should use the pseudo versions from main instead
|
|
||
| // TODO: Comment the line below out when the next version of the API is released. | ||
| // replace github.com/kptdev/kpt/api => ./api | ||
| replace github.com/kptdev/kpt/api => ./api |
There was a problem hiding this comment.
Use pseudo version from the head of main
|
@Adham-Kiwan could you please join our slack and one of the weekly community meetings to talk about your PR briefly? (See https://github.com/kptdev/kpt#contact on how to join) |



Description
This removes the WASM function runtime from kpt, as agreed in #4881 and discussion #4878.
pkg/fn/runtime/wasmtime.go,wasmtime_unsupported.go,nodejs.goandjsglue.go.github.com/bytecodealliance/wasmtime-goandgithub.com/prep/wasmexecdependencies fromgo.mod.NewWasmFnandWasmFn.Runas stubs. Both now return a newErrWasmFunctionsRemovederror:support for WASM functions has been removed from kpt, run the function as a container image or an executable instead. TheWasmLoader,OciLoaderandFsLoadertypes stay, as the issue asks, in case WASM support comes back later.--allow-alpha-wasmflag and its original description onfn evalandfn render, and mark it deprecated with the messagesupport for WASM functions has been removed from kpt(review feedback). Cobra prints that message when the flag is used and hides the flag from--help, and existing scripts get the clear error instead of "unknown flag".fn-render/basicpipeline-wasmandfn-eval/wasm-functione2e cases to expect the new error. Drop theirsetup.sh/teardown.shand theKPT_FN_WASM_RUNTIME ?= nodejsdefault inmake/info.mk, since nothing reads that variable any more.What this PR leaves alone:
kpt alpha wasm push/pullandpkg/wasm. They are OCI push/pull helpers and do not use the runtime. I can remove them here or in a follow-up, whichever you prefer.The documentation. Per the PR template, docs will come in a separate
Docs:PR for Update WASM related documentation #4883.A separate commit, "Build against the in-tree API and root modules", enables the
replacedirectives ingo.modandcli/go.mod. Main hasn't built since Feature: krmignore refactor #4829:pkg/lib/krmvalidateuseskptfilev1.IsKustomization, which no releasedapiversion has yet, so every code PR fails CI the same way. Support per-step timeout field in Kptfile pipeline #4814 does the same thing. Drop that commit if main gets fixed another way first. With it,go mod tidyincli/works again and removes the WASM dependencies there too.Fixes #4882
Testing
go build ./...in the root andcli/modules withGOWORK=off, plusmake fix fmt vet lint tidy(golangci-lint: 0 issues)go test ./pkg/fn/... ./cli/fn/...passgo test --tags=docker --run='TestFnRender/testdata/fn-render/basicpipeline-wasm|TestFnEval/testdata/fn-eval/wasm-function' ./e2e/pass against a freshly built binaryAI usage
I have used AI in the creation of this PR.
I have used the following AI tools:
I have reviewed the change and can explain it independently of the tool.