Skip to content

Commit 9073c9d

Browse files
authored
feat(magefile): allow to customise interp timeout (#301)
Signed-off-by: Andrei Krasnitski <[email protected]>
1 parent d9d8c57 commit 9073c9d

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

magefiles/magefile.go

+15-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,21 @@ func Build() error {
216216
}
217217
}
218218

219-
if err := sh.RunV("tinygo", "build", "-gc=custom", "-opt=2", "-o", filepath.Join("build", "mainraw.wasm"), "-scheduler=none", "-target=wasip1", buildTagArg); err != nil {
219+
buildArgs := []string{
220+
"build",
221+
"-gc=custom",
222+
"-opt=2",
223+
"-o", filepath.Join("build", "mainraw.wasm"),
224+
"-scheduler=none",
225+
"-target=wasip1",
226+
buildTagArg,
227+
}
228+
229+
if interpTimeout, ok := os.LookupEnv("INTERP_TIMEOUT"); ok {
230+
buildArgs = append(buildArgs, "-interp-timeout="+interpTimeout)
231+
}
232+
233+
if err := sh.RunV("tinygo", buildArgs...); err != nil {
220234
return err
221235
}
222236

0 commit comments

Comments
 (0)