Skip to content

Commit dd5ea04

Browse files
committed
ignore: add Go umask files to ephemeral set (docker#5740)
When creating files in Go, the stdlib will create (and then rapidly delete) files ending with `-go-tmp-umask` to determine the umask to use for permission purposes. This can cause trouble with Live Update because the files tend to vanish underneath it, for example. Fixes docker#5117.
1 parent 12de97b commit dd5ea04

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pkg/watch/ephemeral.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import (
55
"github.com/tilt-dev/tilt/pkg/model"
66
)
77

8-
// Filter out spurious changes that we don't want to rebuild on, like IDE
9-
// temp/lock files.
8+
// EphemeralPathMatcher filters out spurious changes that we don't want to
9+
// rebuild on, like IDE temp/lock files.
1010
//
1111
// This isn't an ideal solution. In an ideal world, the user would put
1212
// everything to ignore in their tiltignore/dockerignore files. This is a
@@ -29,12 +29,17 @@ func initEphemeralPathMatcher() model.PathMatcher {
2929
// files, but it doesn't have the "incrememnting" character problem mentioned
3030
// above
3131
katePatterns := []string{"**/.*.kate-swp"}
32+
// go stdlib creates tmpfiles to determine umask for setting permissions
33+
// during file creation; they are then immediately deleted
34+
// https://github.com/golang/go/blob/0b5218cf4e3e5c17344ea113af346e8e0836f6c4/src/cmd/go/internal/work/exec.go#L1764
35+
goPatterns := []string{"**/*-go-tmp-umask"}
3236

3337
allPatterns := []string{}
3438
allPatterns = append(allPatterns, golandPatterns...)
3539
allPatterns = append(allPatterns, emacsPatterns...)
3640
allPatterns = append(allPatterns, vimPatterns...)
3741
allPatterns = append(allPatterns, katePatterns...)
42+
allPatterns = append(allPatterns, goPatterns...)
3843

3944
matcher, err := dockerignore.NewDockerPatternMatcher("/", allPatterns)
4045
if err != nil {

0 commit comments

Comments
 (0)