Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
bin
.certs
.tmp
client/__debug_bin.exe*
.vscode/
Comment on lines +7 to +8
Copy link
Member

@crazy-max crazy-max Nov 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should not be put in project's gitignore as well. If you need these to be ignored, it should be put in your global gitignore through core.excludesFile: https://git-scm.com/docs/gitignore#_configuration

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also squash your commits, thanks!

84 changes: 71 additions & 13 deletions client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7815,21 +7815,30 @@ func testWhiteoutParentDir(t *testing.T, sb integration.Sandbox) {

// #2490
func testMoveParentDir(t *testing.T, sb integration.Sandbox) {
integration.SkipOnPlatform(t, "windows")
workers.CheckFeatureCompat(t, sb, workers.FeatureOCIExporter)
c, err := New(sb.Context(), sb.Address())
require.NoError(t, err)
defer c.Close()

busybox := llb.Image("busybox:latest")
imgName := integration.UnixOrWindows("busybox:latest", "nanoserver:latest")
busybox := llb.Image(imgName)
st := llb.Scratch()

run := func(cmd string) {
st = busybox.Run(llb.Shlex(cmd), llb.Dir("/wd")).AddMount("/wd", st)
}
switch imgName {
case "nanoserver:latest":
run := func(cmd string) {
st = busybox.Run(llb.Shlex(cmd), llb.Dir("/wd")).Root()
}

run(`sh -c "mkdir -p foo; echo -n first > foo/bar;"`)
run(`mv foo foo2`)
run(`cmd /c "mkdir foo && echo first > foo/bar && move foo foo2"`)
case "busybox:latest":
run := func(cmd string) {
st = busybox.Run(llb.Shlex(cmd), llb.Dir("/wd")).AddMount("/wd", st)
}

run(`sh -c "mkdir -p foo; echo -n first > foo/bar;"`)
run(`mv foo foo2`)
}

def, err := st.Marshal(sb.Context())
require.NoError(t, err)
Expand Down Expand Up @@ -7871,14 +7880,63 @@ func testMoveParentDir(t *testing.T, sb integration.Sandbox) {
m, err = testutil.ReadTarToMap(layer.Data, true)
require.NoError(t, err)

_, ok = m[".wh.foo"]
require.True(t, ok)
switch imgName {
case "nanoserver:latest":
_, ok = m["/wd/foo/bar"] //Should be false, else move didn't happen
require.False(t, ok)

_, ok = m["foo2/"]
require.True(t, ok)
_, ok = m["Files/wd/foo/bar"] //Should be false, else move didn't happen
require.False(t, ok)

_, ok = m["foo2/bar"]
require.True(t, ok)
_, ok = m["Files/wd/foo2/bar"]
require.True(t, ok)

_, ok = m["Files/wd/foo2"]
require.True(t, ok)

_, ok = m["Files/wd"]
require.True(t, ok)

for key := range m {
if err == nil && strings.Contains(key, "/wd") {
ok = true
break
} else {
ok = false
}
}
require.True(t, ok)

for key := range m {
if err == nil && strings.Contains(key, "/foo2/bar") {
ok = true
break
} else {
ok = false
}
}
require.True(t, ok)

for key := range m {
if err == nil && strings.Contains(key, "/foo2") {
ok = true
break
} else {
ok = false
}

}
require.True(t, ok)
case "busybox:latest":
_, ok = m[".wh.foo"]
require.True(t, ok)

_, ok = m["foo2/"]
require.True(t, ok)

_, ok = m["foo2/bar"]
require.True(t, ok)
}
}

// #319
Expand Down
Binary file added frontend/dockerfile/__debug_bin.exe
Binary file not shown.
Binary file added frontend/dockerfile/__debug_bin.exe1044302703
Binary file not shown.
Binary file added frontend/dockerfile/__debug_bin.exe1231169457
Binary file not shown.
Binary file added frontend/dockerfile/__debug_bin.exe2503292912
Binary file not shown.
Binary file added frontend/dockerfile/__debug_bin.exe439976611
Binary file not shown.
6 changes: 3 additions & 3 deletions frontend/dockerfile/dockerfile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ RUN cmd /V:on /C "set /p tfcontent=<\sample\testfile \
}

func testCopyLinkDotDestDir(t *testing.T, sb integration.Sandbox) {
integration.SkipOnPlatform(t, "windows", "COPY --link requires diffApply which is not supported on Windows")
integration.SkipOnPlatform(t, "windows", "COPY --link requires diffApply which is not supported on Windows or set COPY --link=false for default COPY behavior")
f := getFrontend(t, sb)

dockerfile := []byte(`
Expand Down Expand Up @@ -650,7 +650,7 @@ RUN [ "$(cat testfile)" == "contents0" ]
}

func testCopyLinkEmptyDestDir(t *testing.T, sb integration.Sandbox) {
integration.SkipOnPlatform(t, "windows", "COPY --link requires diffApply which is not supported on Windows")
integration.SkipOnPlatform(t, "windows", "COPY --link requires diffApply which is not supported on Windows or set COPY --link=false for default COPY behavior")
f := getFrontend(t, sb)

dockerfile := []byte(`
Expand Down Expand Up @@ -824,7 +824,7 @@ COPY foo foo
}

func testTarExporterMulti(t *testing.T, sb integration.Sandbox) {
integration.SkipOnPlatform(t, "windows", "Multi-platform tar export test specifically targets linux/amd64 and darwin/amd64 platforms")
integration.SkipOnPlatform(t, "windows", "Multi-platform tar export test specifically targets linux/amd64 and darwin/amd64 platforms as it's unsupported on Windows")
f := getFrontend(t, sb)

dockerfile := []byte(`
Expand Down