Make most of libpod, and everything that relies on it, non-darwin

Require (linux || freebsd), because the code already does that, in practice.
This just means macOS users of IDEs aren't hit with thousands of compilation
errors (and then the IDE can open an Linux-specific file and then process it
under the Linux assumption, which works much better).

This commit contains the parts that differ somehow.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
Miloslav Trmač
2026-02-27 22:18:44 +01:00
parent 4c3027c149
commit d06c4569f0
6 changed files with 6 additions and 49 deletions

View File

@@ -1,4 +1,4 @@
//go:build !remote
//go:build !remote && (linux || freebsd)
package libpod
@@ -7,7 +7,6 @@ import (
"fmt"
"os"
"path/filepath"
"runtime"
"strings"
"testing"
@@ -18,7 +17,8 @@ import (
)
// hookPath is the path to an example hook executable.
var hookPath string
// This would need to be updated for Windows.
const hookPath = "/bin/sh"
func TestParseOptionIDs(t *testing.T) {
idMap := []idtools.IDMap{
@@ -205,11 +205,3 @@ func TestPostDeleteHooks(t *testing.T) {
}
assert.Equal(t, strings.TrimSuffix(string(content), "\n"), dir)
}
func init() {
if runtime.GOOS != "windows" {
hookPath = "/bin/sh"
} else {
panic("we need a reliable executable path on Windows")
}
}

View File

@@ -1,4 +1,4 @@
//go:build !remote && (!linux || !systemd)
//go:build !remote && ((linux && !systemd) || freebsd)
package libpod

View File

@@ -1,4 +1,4 @@
//go:build !remote && !(linux && cgo) && !freebsd
//go:build !remote && linux && !cgo
package libpod

View File

@@ -1,4 +1,4 @@
//go:build !remote && !linux
//go:build !remote && freebsd
package libpod

View File

@@ -1,11 +0,0 @@
//go:build !remote && !linux && !freebsd
package libpod
import (
"errors"
)
func (r *Runtime) stopPauseProcess() error {
return errors.New("not implemented (*Runtime) stopPauseProcess")
}

View File

@@ -1,24 +0,0 @@
//go:build !linux && !freebsd && !remote
package terminal
import (
"context"
"errors"
"os"
"github.com/containers/podman/v6/libpod"
"github.com/containers/podman/v6/libpod/define"
)
// ExecAttachCtr execs and attaches to a container
func ExecAttachCtr(ctx context.Context, ctr *libpod.Container, execConfig *libpod.ExecConfig, streams *define.AttachStreams) (int, error) {
return -1, errors.New("not implemented ExecAttachCtr")
}
// StartAttachCtr starts and (if required) attaches to a container
// if you change the signature of this function from os.File to io.Writer, it will trigger a downstream
// error. we may need to just lint disable this one.
func StartAttachCtr(ctx context.Context, ctr *libpod.Container, stdout, stderr, stdin *os.File, detachKeys string, sigProxy bool, startContainer bool) error { //nolint: interfacer
return errors.New("not implemented StartAttachCtr")
}