diff --git a/GNUmakefile b/GNUmakefile index e66b6af29f..2bf023c627 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -926,6 +926,7 @@ endif @cp -rp lib/musl/src/env build/release/tinygo/lib/musl/src @cp -rp lib/musl/src/errno build/release/tinygo/lib/musl/src @cp -rp lib/musl/src/exit build/release/tinygo/lib/musl/src + @cp -rp lib/musl/src/fcntl build/release/tinygo/lib/musl/src @cp -rp lib/musl/src/include build/release/tinygo/lib/musl/src @cp -rp lib/musl/src/internal build/release/tinygo/lib/musl/src @cp -rp lib/musl/src/legacy build/release/tinygo/lib/musl/src diff --git a/main_test.go b/main_test.go index ecff134275..f4f08e3c88 100644 --- a/main_test.go +++ b/main_test.go @@ -341,8 +341,7 @@ func emuCheck(t *testing.T, options compileopts.Options) { } if spec.Emulator != "" { emulatorCommand := strings.SplitN(spec.Emulator, " ", 2)[0] - _, err := exec.LookPath(emulatorCommand) - if err != nil { + if _, err := exec.LookPath(emulatorCommand); err != nil { if errors.Is(err, exec.ErrNotFound) { t.Skipf("emulator not installed: %q", emulatorCommand) } @@ -672,8 +671,7 @@ func TestWasmExport(t *testing.T) { builder := r.NewHostModuleBuilder("tester") builder.NewFunctionBuilder().WithFunc(callOutside).Export("callOutside") builder.NewFunctionBuilder().WithFunc(callTestMain).Export("callTestMain") - _, err = builder.Instantiate(ctx) - if err != nil { + if _, err = builder.Instantiate(ctx); err != nil { t.Fatal(err) } @@ -730,8 +728,7 @@ func TestWasmFuncOf(t *testing.T) { cmd := exec.Command("node", "testdata/wasmfunc.js", result.Binary, buildConfig.BuildMode()) cmd.Stdout = output cmd.Stderr = output - err = cmd.Run() - if err != nil { + if err = cmd.Run(); err != nil { t.Error("failed to run node:", err) } checkOutput(t, "testdata/wasmfunc.txt", output.Bytes()) @@ -771,8 +768,8 @@ func TestWasmExportJS(t *testing.T) { cmd := exec.Command("node", "testdata/wasmexport.js", result.Binary, buildConfig.BuildMode()) cmd.Stdout = output cmd.Stderr = output - err = cmd.Run() - if err != nil { + + if err = cmd.Run(); err != nil { t.Error("failed to run node:", err) } checkOutput(t, "testdata/wasmexport.txt", output.Bytes()) @@ -1037,8 +1034,7 @@ func TestMain(m *testing.M) { switch os.Args[1] { case "clang", "ld.lld", "wasm-ld": // Invoke a specific tool. - err := builder.RunTool(os.Args[1], os.Args[2:]...) - if err != nil { + if err := builder.RunTool(os.Args[1], os.Args[2:]...); err != nil { // The tool should have printed an error message already. // Don't print another error message here. os.Exit(1)