Skip to content

Commit

Permalink
main: don't detect WebAssembly from the .wasm extension
Browse files Browse the repository at this point in the history
Currently this overrides GOOS/GOARCH, which are also used for wasm.
This will break people who rely on a command like this:

    tinygo build -o foo.wasm path/to/package

They will need to update to explicitly set the target, for example:

    tinygo build -o foo.wasm -target=wasm path/to/package

Fixes: #4439
  • Loading branch information
aykevl authored and deadprogram committed Dec 9, 2024
1 parent 31f7214 commit ce0d8df
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -1685,9 +1685,6 @@ func main() {
usage(command)
os.Exit(1)
}
if options.Target == "" && filepath.Ext(outpath) == ".wasm" {
options.Target = "wasm"
}

err := Build(pkgName, outpath, options)
handleCompilerError(err)
Expand Down

0 comments on commit ce0d8df

Please sign in to comment.