@@ -318,15 +318,9 @@ func compileArchive(
318
318
}
319
319
defer os .Remove (importcfgPath )
320
320
321
- // tempdir to store nogo facts and pkgdef for packaging later
322
- xTempDir , err := ioutil .TempDir (filepath .Dir (outXPath ), "x_files" )
323
- if err != nil {
324
- return err
325
- }
326
- defer os .RemoveAll (xTempDir )
327
321
// Run nogo concurrently.
328
322
var nogoChan chan error
329
- outFactsPath := filepath .Join (xTempDir , nogoFact )
323
+ outFactsPath := filepath .Join (workDir , nogoFact )
330
324
if nogoPath != "" {
331
325
ctx , cancel := context .WithCancel (context .Background ())
332
326
nogoChan = make (chan error )
@@ -415,10 +409,10 @@ func compileArchive(
415
409
// copy the nogo facts into the .x file. Unfortunately, when building a plugin,
416
410
// the linker needs export data in the .a file. To work around this, we copy
417
411
// the export data into the .x file ourselves.
418
- if err = extractFileFromArchive (outPath , xTempDir , pkgDef ); err != nil {
412
+ if err = extractFileFromArchive (outPath , workDir , pkgDef ); err != nil {
419
413
return err
420
414
}
421
- pkgDefPath := filepath .Join (xTempDir , pkgDef )
415
+ pkgDefPath := filepath .Join (workDir , pkgDef )
422
416
if nogoStatus == nogoSucceeded {
423
417
return appendFiles (goenv , outXPath , []string {pkgDefPath , outFactsPath })
424
418
}
0 commit comments