Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions go/tools/builders/compilepkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,15 +318,9 @@ func compileArchive(
}
defer os.Remove(importcfgPath)

// tempdir to store nogo facts and pkgdef for packaging later
xTempDir, err := ioutil.TempDir(filepath.Dir(outXPath), "x_files")
if err != nil {
return err
}
defer os.RemoveAll(xTempDir)
// Run nogo concurrently.
var nogoChan chan error
outFactsPath := filepath.Join(xTempDir, nogoFact)
outFactsPath := filepath.Join(workDir, nogoFact)
if nogoPath != "" {
ctx, cancel := context.WithCancel(context.Background())
nogoChan = make(chan error)
Expand Down Expand Up @@ -415,10 +409,10 @@ func compileArchive(
// copy the nogo facts into the .x file. Unfortunately, when building a plugin,
// the linker needs export data in the .a file. To work around this, we copy
// the export data into the .x file ourselves.
if err = extractFileFromArchive(outPath, xTempDir, pkgDef); err != nil {
if err = extractFileFromArchive(outPath, workDir, pkgDef); err != nil {
return err
}
pkgDefPath := filepath.Join(xTempDir, pkgDef)
pkgDefPath := filepath.Join(workDir, pkgDef)
if nogoStatus == nogoSucceeded {
return appendFiles(goenv, outXPath, []string{pkgDefPath, outFactsPath})
}
Expand Down