feat: support platforms other than Linux
johnstcn opened this issue · comments
This provider currently only builds for GOOS=linux:
GOOS=darwin CGO_ENABLED=0 go build .
# github.com/docker/docker/volume/mounts
../../../go/pkg/mod/github.com/docker/docker@v26.1.4+incompatible/volume/mounts/mounts.go:187:30: undefined: safepath.Join
# github.com/GoogleContainerTools/kaniko/pkg/snapshot
../../../go/pkg/mod/github.com/coder/kaniko@v0.0.0-20240807142221-ffc5e60fca41/pkg/snapshot/snapshot.go:182:39: undefined: unix.SYS_SYNCFS
# github.com/docker/docker/libcontainerd/types
../../../go/pkg/mod/github.com/docker/docker@v26.1.4+incompatible/libcontainerd/types/types.go:88:31: undefined: Stats
../../../go/pkg/mod/github.com/docker/docker@v26.1.4+incompatible/libcontainerd/types/types.go:91:34: undefined: Summary
../../../go/pkg/mod/github.com/docker/docker@v26.1.4+incompatible/libcontainerd/types/types.go:98:50: undefined: Resources
# github.com/coder/envbuilder/internal/ebutil
../../../go/pkg/mod/github.com/coder/envbuilder@v1.0.0-rc.0.0.20240807151028-6e5bfa5faa29/internal/ebutil/remount.go:151:47: undefined: syscall.MS_BIND
../../../go/pkg/mod/github.com/coder/envbuilder@v1.0.0-rc.0.0.20240807151028-6e5bfa5faa29/internal/ebutil/remount.go:189:17: undefined: syscall.Mount
$ GOOS=windows CGO_ENABLED=0 go build .
# github.com/coder/envbuilder/devcontainer
../../../go/pkg/mod/github.com/coder/envbuilder@v1.0.0-rc.0.0.20240807151028-6e5bfa5faa29/devcontainer/script.go:88:4: unknown field Credential in struct literal of type syscall.SysProcAttr
../../../go/pkg/mod/github.com/coder/envbuilder@v1.0.0-rc.0.0.20240807151028-6e5bfa5faa29/devcontainer/script.go:88:25: undefined: syscall.Credential
../../../go/pkg/mod/github.com/coder/envbuilder@v1.0.0-rc.0.0.20240807151028-6e5bfa5faa29/devcontainer/script.go:100:24: undefined: syscall.ForkExec
../../../go/pkg/mod/github.com/coder/envbuilder@v1.0.0-rc.0.0.20240807151028-6e5bfa5faa29/devcontainer/script.go:116:24: undefined: syscall.ForkExec
# github.com/GoogleContainerTools/kaniko/pkg/util
../../../go/pkg/mod/github.com/coder/kaniko@v0.0.0-20240807142221-ffc5e60fca41/pkg/util/syscall_credentials.go:29:51: undefined: syscall.Credential
../../../go/pkg/mod/github.com/coder/kaniko@v0.0.0-20240807142221-ffc5e60fca41/pkg/util/syscall_credentials.go:44:17: undefined: groupIDs
../../../go/pkg/mod/github.com/coder/kaniko@v0.0.0-20240807142221-ffc5e60fca41/pkg/util/syscall_credentials.go:64:18: undefined: syscall.Credential
../../../go/pkg/mod/github.com/coder/kaniko@v0.0.0-20240807142221-ffc5e60fca41/pkg/util/tar_util.go:241:46: undefined: syscall.Stat_t
../../../go/pkg/mod/github.com/coder/kaniko@v0.0.0-20240807142221-ffc5e60fca41/pkg/util/fs_util.go:667:37: undefined: syscall.Stat_t
../../../go/pkg/mod/github.com/coder/kaniko@v0.0.0-20240807142221-ffc5e60fca41/pkg/util/fs_util.go:767:34: undefined: syscall.Stat_t
../../../go/pkg/mod/github.com/coder/kaniko@v0.0.0-20240807142221-ffc5e60fca41/pkg/util/fs_util.go:770:34: undefined: syscall.Stat_t
../../../go/pkg/mod/github.com/coder/kaniko@v0.0.0-20240807142221-ffc5e60fca41/pkg/util/fs_util.go:1145:32: undefined: syscall.Stat_t
../../../go/pkg/mod/github.com/coder/kaniko@v0.0.0-20240807142221-ffc5e60fca41/pkg/util/fs_util.go:1330:30: undefined: syscall.Stat_t
../../../go/pkg/mod/github.com/coder/kaniko@v0.0.0-20240807142221-ffc5e60fca41/pkg/util/fs_util.go:1332:30: undefined: syscall.Stat_t
../../../go/pkg/mod/github.com/coder/kaniko@v0.0.0-20240807142221-ffc5e60fca41/pkg/util/syscall_credentials.go:64:18: too many errors
# github.com/coder/envbuilder/internal/ebutil
../../../go/pkg/mod/github.com/coder/envbuilder@v1.0.0-rc.0.0.20240807151028-6e5bfa5faa29/internal/ebutil/remount.go:151:47: undefined: syscall.MS_BIND
../../../go/pkg/mod/github.com/coder/envbuilder@v1.0.0-rc.0.0.20240807151028-6e5bfa5faa29/internal/ebutil/remount.go:189:17: undefined: syscall.Mount
../../../go/pkg/mod/github.com/coder/envbuilder@v1.0.0-rc.0.0.20240807151028-6e5bfa5faa29/internal/ebutil/remount.go:193:17: undefined: syscall.Unmount
$ GOOS=freebsd CGO_ENABLED=0 go build .
# github.com/docker/docker/volume/mounts
../../../go/pkg/mod/github.com/docker/docker@v26.1.4+incompatible/volume/mounts/mounts.go:187:30: undefined: safepath.Join
# github.com/docker/docker/libcontainerd/types
../../../go/pkg/mod/github.com/docker/docker@v26.1.4+incompatible/libcontainerd/types/types.go:88:31: undefined: Stats
../../../go/pkg/mod/github.com/docker/docker@v26.1.4+incompatible/libcontainerd/types/types.go:91:34: undefined: Summary
../../../go/pkg/mod/github.com/docker/docker@v26.1.4+incompatible/libcontainerd/types/types.go:98:50: undefined: Resources
# github.com/docker/docker/daemon/graphdriver
../../../go/pkg/mod/github.com/docker/docker@v26.1.4+incompatible/daemon/graphdriver/driver_freebsd.go:15:38: cannot use &buf (value of type *"golang.org/x/sys/unix".Statfs_t) as *syscall.Statfs_t value in argument to syscall.Statfs
# github.com/GoogleContainerTools/kaniko/pkg/util
../../../go/pkg/mod/github.com/coder/kaniko@v0.0.0-20240807142221-ffc5e60fca41/pkg/util/syscall_credentials.go:44:17: undefined: groupIDs
../../../go/pkg/mod/github.com/coder/kaniko@v0.0.0-20240807142221-ffc5e60fca41/pkg/util/util.go:255:29: undefined: unix.ENODATA
# github.com/coder/envbuilder/internal/ebutil
../../../go/pkg/mod/github.com/coder/envbuilder@v1.0.0-rc.0.0.20240807151028-6e5bfa5faa29/internal/ebutil/remount.go:151:47: undefined: syscall.MS_BIND
../../../go/pkg/mod/github.com/coder/envbuilder@v1.0.0-rc.0.0.20240807151028-6e5bfa5faa29/internal/ebutil/remount.go:189:17: undefined: syscall.Mount
Does it mean it can't be used if Terraform runs on a macOS or Windows provider?
Yes, the provider binary currently cannot be compiled on macOS or Windows so it will not be usable on those platforms unless Terraform is run in a VM.
We have a Discord user asking for this feature.
They are getting the following error when trying to run on macOS (on Apple Silicon).
Error: Incompatible provider version
Provider registry.terraform.io/coder/envbuilder v1.0.0 does not have a
package available for your current platform, darwin_arm64.
Provider releases are separate from Terraform CLI releases, so not all
providers are available for all platforms. Other versions of this provider
may have different platforms supported.
I think this is something that is going to slow us down if people are willing to test out Coder on their workstation.