Skip to content

Commit

Permalink
Merge pull request #5659 from thaJeztah/reexec_windows_only
Browse files Browse the repository at this point in the history
cmd/buildkitd: move reexec.Init to non-Linux files
  • Loading branch information
tonistiigi authored Jan 15, 2025
2 parents dd06922 + e1d393e commit f33e27e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
5 changes: 0 additions & 5 deletions cmd/buildkitd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ import (
"github.com/moby/buildkit/util/tracing/transform"
"github.com/moby/buildkit/version"
"github.com/moby/buildkit/worker"
"github.com/moby/sys/reexec"
"github.com/moby/sys/userns"
ocispecs "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/pkg/errors"
Expand All @@ -81,10 +80,6 @@ func init() {
apicaps.ExportedProduct = "buildkit"
stack.SetVersionInfo(version.Version, version.Revision)

if reexec.Init() {
os.Exit(0)
}

// enable in memory recording for buildkitd traces
detect.Recorder = detect.NewTraceRecorder()
}
Expand Down
15 changes: 15 additions & 0 deletions cmd/buildkitd/main_nolinux.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//go:build !linux

package main

import (
"os"

"github.com/moby/sys/reexec"
)

func init() {
if reexec.Init() {
os.Exit(0)
}
}

0 comments on commit f33e27e

Please sign in to comment.