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 committed Aug 29, 2024
1 parent d144b11 commit d80668b
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 @@ -1564,9 +1564,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 d80668b

Please sign in to comment.