|
8 | 8 | "os" |
9 | 9 | "os/exec" |
10 | 10 | "path/filepath" |
11 | | - "runtime" |
12 | 11 | "strings" |
13 | 12 | "testing" |
14 | 13 | "time" |
@@ -181,14 +180,6 @@ func newSandbox(ctx context.Context, w Worker, mirror string, mv matrixValue) (s |
181 | 180 | }, cl, nil |
182 | 181 | } |
183 | 182 |
|
184 | | -func getBuildkitdAddr(tmpdir string) string { |
185 | | - address := "unix://" + filepath.Join(tmpdir, "buildkitd.sock") |
186 | | - if runtime.GOOS == "windows" { |
187 | | - address = "//./pipe/buildkitd-" + filepath.Base(tmpdir) |
188 | | - } |
189 | | - return address |
190 | | -} |
191 | | - |
192 | 183 | func runBuildkitd(ctx context.Context, conf *BackendConfig, args []string, logs map[string]*bytes.Buffer, uid, gid int, extraEnv []string) (address string, cl func() error, err error) { |
193 | 184 | deferF := &multiCloser{} |
194 | 185 | cl = deferF.F() |
@@ -224,7 +215,7 @@ func runBuildkitd(ctx context.Context, conf *BackendConfig, args []string, logs |
224 | 215 |
|
225 | 216 | args = append(args, "--root", tmpdir, "--addr", address, "--debug") |
226 | 217 | cmd := exec.Command(args[0], args[1:]...) //nolint:gosec // test utility |
227 | | - cmd.Env = append(os.Environ(), "BUILDKIT_DEBUG_EXEC_OUTPUT=1", "BUILDKIT_DEBUG_PANIC_ON_ERROR=1", "TMPDIR="+filepath.Join(tmpdir, "tmp")) |
| 218 | + cmd.Env = append(os.Environ(), "BUILDKIT_DEBUG_EXEC_OUTPUT=1", "BUILDKIT_DEBUG_PANIC_ON_ERROR=1", "BUILDKIT_TRACE_SOCKET="+getTraceSocketPath(tmpdir), "TMPDIR="+filepath.Join(tmpdir, "tmp")) |
228 | 219 | cmd.Env = append(cmd.Env, extraEnv...) |
229 | 220 | cmd.SysProcAttr = getSysProcAttr() |
230 | 221 |
|
@@ -269,7 +260,7 @@ func getBackend(sb Sandbox) (*backend, error) { |
269 | 260 | } |
270 | 261 |
|
271 | 262 | func rootlessSupported(uid int) bool { |
272 | | - cmd := exec.Command("sudo", "-u", fmt.Sprintf("#%d", uid), "-i", "--", "exec", "unshare", "-U", "true") //nolint:gosec // test utility |
| 263 | + cmd := exec.Command("sudo", "-E", "-u", fmt.Sprintf("#%d", uid), "-i", "--", "exec", "unshare", "-U", "true") //nolint:gosec // test utility |
273 | 264 | b, err := cmd.CombinedOutput() |
274 | 265 | if err != nil { |
275 | 266 | bklog.L.Warnf("rootless mode is not supported on this host: %v (%s)", err, string(b)) |
|
0 commit comments