From 3ca6321907486708f0bc677f6d5a26413076e44c Mon Sep 17 00:00:00 2001 From: Jesse Sivonen Date: Fri, 22 Aug 2025 20:44:13 +0300 Subject: [PATCH] [#7116] exclude `syscall.Exec` for WASM --- core/base.go | 3 +-- core/syscall.go | 9 +++++++++ core/syscall_wasm.go | 9 +++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 core/syscall.go create mode 100644 core/syscall_wasm.go diff --git a/core/base.go b/core/base.go index 15f16ae9..0d4f58c4 100644 --- a/core/base.go +++ b/core/base.go @@ -12,7 +12,6 @@ import ( "regexp" "runtime" "strings" - "syscall" "time" "github.com/fatih/color" @@ -773,7 +772,7 @@ func (app *BaseApp) Restart() error { } }() - return syscall.Exec(execPath, os.Args, os.Environ()) + return exec(execPath, os.Args, os.Environ()) }) } diff --git a/core/syscall.go b/core/syscall.go new file mode 100644 index 00000000..3b7cbfdf --- /dev/null +++ b/core/syscall.go @@ -0,0 +1,9 @@ +//go:build !(js && wasm) + +package core + +import "syscall" + +func exec(argv0 string, argv []string, envv []string) error { + return syscall.Exec(argv0, argv, envv) +} diff --git a/core/syscall_wasm.go b/core/syscall_wasm.go new file mode 100644 index 00000000..a971fb6a --- /dev/null +++ b/core/syscall_wasm.go @@ -0,0 +1,9 @@ +//go:build js && wasm + +package core + +import "errors" + +func exec(argv0 string, argv []string, envv []string) error { + return errors.ErrUnsupported +}