1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
From dfb087d04ed38c8e2ef377d0afca6b7d8e409d3d Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex.kanavin@gmail.com>
Date: Mon, 23 Nov 2020 18:30:58 +0000
Subject: [PATCH] action: do not clear temp dir
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
src/cmd/go/internal/work/action.go | 24 +++---------------------
1 file changed, 3 insertions(+), 21 deletions(-)
diff --git a/src/cmd/go/internal/work/action.go b/src/cmd/go/internal/work/action.go
index 2ab7860..f195800 100644
--- a/src/cmd/go/internal/work/action.go
+++ b/src/cmd/go/internal/work/action.go
@@ -16,7 +16,6 @@ import (
"io/ioutil"
"os"
"path/filepath"
- "runtime"
"strings"
"sync"
"time"
@@ -256,7 +255,7 @@ func (b *Builder) Init() {
if !filepath.IsAbs(tmp) {
abs, err := filepath.Abs(tmp)
if err != nil {
- os.RemoveAll(tmp)
+ //os.RemoveAll(tmp)
base.Fatalf("go: creating work dir: %v", err)
}
tmp = abs
@@ -266,26 +265,9 @@ func (b *Builder) Init() {
fmt.Fprintf(os.Stderr, "WORK=%s\n", b.WorkDir)
}
if !cfg.BuildWork {
- workdir := b.WorkDir
+ //workdir := b.WorkDir
base.AtExit(func() {
- start := time.Now()
- for {
- err := os.RemoveAll(workdir)
- if err == nil {
- return
- }
-
- // On some configurations of Windows, directories containing executable
- // files may be locked for a while after the executable exits (perhaps
- // due to antivirus scans?). It's probably worth a little extra latency
- // on exit to avoid filling up the user's temporary directory with leaked
- // files. (See golang.org/issue/30789.)
- if runtime.GOOS != "windows" || time.Since(start) >= 500*time.Millisecond {
- fmt.Fprintf(os.Stderr, "go: failed to remove work dir: %s\n", err)
- return
- }
- time.Sleep(5 * time.Millisecond)
- }
+ return
})
}
}
|