Skip to content

Commit

Permalink
tinygo: detect GOOS=wasip1 for relative WASI paths via config instead…
Browse files Browse the repository at this point in the history
… of target name (tinygo-org#4423)
  • Loading branch information
ydnar authored Aug 21, 2024
1 parent ef4f46f commit 336b9b3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,13 +305,11 @@ func Test(pkgName string, stdout, stderr io.Writer, options *compileopts.Options
//
// Ex. run --dir=.. --dir=../.. --dir=../../..
var dirs []string
switch config.Options.Target {
switch config.Target.GOOS {
case "wasip1":
dirs = dirsToModuleRootRel(result.MainDir, result.ModuleRoot)
case "wasip2":
dirs = dirsToModuleRootAbs(result.MainDir, result.ModuleRoot)
default:
return fmt.Errorf("unknown GOOS target: %v", config.Options.Target)
dirs = dirsToModuleRootAbs(result.MainDir, result.ModuleRoot)
}

args := []string{"run"}
Expand Down

0 comments on commit 336b9b3

Please sign in to comment.