From 13a8eae0d4bce114405f175d4e73ec5a8b07a3aa Mon Sep 17 00:00:00 2001 From: Dan Kegel Date: Wed, 20 Sep 2023 10:55:49 -0700 Subject: [PATCH] build: build Go SSA serially [issue 3895] From https://github.com/tinygo-org/tinygo/pull/3915#issuecomment-1724405109 According to Ayke, it slows down the build but seems to reliably fix https://github.com/tinygo-org/tinygo/issues/3895 --- builder/build.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/builder/build.go b/builder/build.go index 85114d9d..dc360b92 100644 --- a/builder/build.go +++ b/builder/build.go @@ -344,6 +344,10 @@ func Build(pkgName, outpath, tmpdir string, config *compileopts.Config) (BuildRe } packageActionIDJobs[pkg.ImportPath] = packageActionIDJob + // Build the SSA for the given package. + ssaPkg := program.Package(pkg.Pkg) + ssaPkg.Build() + // Now create the job to actually build the package. It will exit early // if the package is already compiled. job := &compileJob{