Skip to content

Commit e1d393e

Browse files
committed
cmd/buildkitd: move reexec.Init to non-Linux files
reexec is only used on Windows and BSD for; - util/system/getuserinfo (lookup user information) - source/git (git operations) updates 698acd3 Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent dd06922 commit e1d393e

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

cmd/buildkitd/main.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ import (
5858
"github.com/moby/buildkit/util/tracing/transform"
5959
"github.com/moby/buildkit/version"
6060
"github.com/moby/buildkit/worker"
61-
"github.com/moby/sys/reexec"
6261
"github.com/moby/sys/userns"
6362
ocispecs "github.com/opencontainers/image-spec/specs-go/v1"
6463
"github.com/pkg/errors"
@@ -81,10 +80,6 @@ func init() {
8180
apicaps.ExportedProduct = "buildkit"
8281
stack.SetVersionInfo(version.Version, version.Revision)
8382

84-
if reexec.Init() {
85-
os.Exit(0)
86-
}
87-
8883
// enable in memory recording for buildkitd traces
8984
detect.Recorder = detect.NewTraceRecorder()
9085
}

cmd/buildkitd/main_nolinux.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//go:build !linux
2+
3+
package main
4+
5+
import (
6+
"os"
7+
8+
"github.com/moby/sys/reexec"
9+
)
10+
11+
func init() {
12+
if reexec.Init() {
13+
os.Exit(0)
14+
}
15+
}

0 commit comments

Comments
 (0)