full diff: https://github.com/moby/buildkit/compare/a7d7b7f1e6bfc102810079f13212de6a869c494b...dc6afa0f755f6cbb7e85f0df4ff4b87ec280cb32
- solver: avoid recursive loop on cache-export
- fixes moby/buildkit#1336 --export-cache option crashes buildkitd on custom frontend
- fixes moby/buildkit#1313 Dockerd / buildkit in a infinite loop and burning cpu
- fixes / addresses moby/moby#41044 19.03.9 goroutine stack exceeds 1000000000-byte limit
- fixes / addresses moby/moby#40993 Multistage docker build fails with unexpected EOF
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
| ... | ... |
@@ -26,7 +26,7 @@ github.com/imdario/mergo 7c29201646fa3de8506f70121347 |
| 26 | 26 |
golang.org/x/sync e225da77a7e68af35c70ccbf71af2b83e6acac3c |
| 27 | 27 |
|
| 28 | 28 |
# buildkit |
| 29 |
-github.com/moby/buildkit a7d7b7f1e6bfc102810079f13212de6a869c494b # v0.6.4-11-ga7d7b7f1 |
|
| 29 |
+github.com/moby/buildkit dc6afa0f755f6cbb7e85f0df4ff4b87ec280cb32 # v0.6.4-15-gdc6afa0f |
|
| 30 | 30 |
github.com/tonistiigi/fsutil 6c909ab392c173a4264ae1bfcbc0450b9aac0c7d |
| 31 | 31 |
github.com/grpc-ecosystem/grpc-opentracing 8e809c8a86450a29b90dcc9efbf062d0fe6d9746 |
| 32 | 32 |
github.com/opentracing/opentracing-go 1361b9cd60be79c4c3a7fa9841b3c132e40066a7 |
| ... | ... |
@@ -20,11 +20,12 @@ func addBacklinks(t CacheExporterTarget, rec CacheExporterRecord, cm *cacheManag |
| 20 | 20 |
if rec == nil {
|
| 21 | 21 |
var ok bool |
| 22 | 22 |
rec, ok = bkm[id] |
| 23 |
- if ok {
|
|
| 23 |
+ if ok && rec != nil {
|
|
| 24 | 24 |
return rec, nil |
| 25 | 25 |
} |
| 26 | 26 |
_ = ok |
| 27 | 27 |
} |
| 28 |
+ bkm[id] = nil |
|
| 28 | 29 |
if err := cm.backend.WalkBacklinks(id, func(id string, link CacheInfoLink) error {
|
| 29 | 30 |
if rec == nil {
|
| 30 | 31 |
rec = t.Add(link.Digest) |
| ... | ... |
@@ -37,7 +38,9 @@ func addBacklinks(t CacheExporterTarget, rec CacheExporterRecord, cm *cacheManag |
| 37 | 37 |
return err |
| 38 | 38 |
} |
| 39 | 39 |
} |
| 40 |
- rec.LinkFrom(r, int(link.Input), link.Selector.String()) |
|
| 40 |
+ if r != nil {
|
|
| 41 |
+ rec.LinkFrom(r, int(link.Input), link.Selector.String()) |
|
| 42 |
+ } |
|
| 41 | 43 |
return nil |
| 42 | 44 |
}); err != nil {
|
| 43 | 45 |
return nil, err |
| ... | ... |
@@ -66,6 +69,7 @@ func (e *exporter) ExportTo(ctx context.Context, t CacheExporterTarget, opt Cach |
| 66 | 66 |
if t.Visited(e) {
|
| 67 | 67 |
return e.res, nil |
| 68 | 68 |
} |
| 69 |
+ t.Visit(e) |
|
| 69 | 70 |
|
| 70 | 71 |
deps := e.k.Deps() |
| 71 | 72 |
|
| ... | ... |
@@ -177,7 +181,6 @@ func (e *exporter) ExportTo(ctx context.Context, t CacheExporterTarget, opt Cach |
| 177 | 177 |
} |
| 178 | 178 |
|
| 179 | 179 |
e.res = allRec |
| 180 |
- t.Visit(e) |
|
| 181 | 180 |
|
| 182 | 181 |
return e.res, nil |
| 183 | 182 |
} |