diff --git a/internal/command/darwin.go b/internal/command/darwin.go index dd03678..81221e5 100644 --- a/internal/command/darwin.go +++ b/internal/command/darwin.go @@ -5,6 +5,7 @@ import ( "fmt" "os" "runtime" + "strings" "github.com/fyne-io/fyne-cross/internal/log" "github.com/fyne-io/fyne-cross/internal/volume" @@ -66,9 +67,8 @@ func (cmd *darwin) Parse(args []string) error { // Add flags to use only on darwin host if runtime.GOOS == darwinOS { flagSet.BoolVar(&cmd.localBuild, "local", true, "If set uses the fyne CLI tool installed on the host in place of the docker images") - } else { - flagSet.StringVar(&flags.MacOSXSDKPath, "macosx-sdk-path", "unset", "Path to macOS SDK (setting it to 'bundled' indicates that the sdk is expected to be in the container) [required]") } + flagSet.StringVar(&flags.MacOSXSDKPath, "macosx-sdk-path", "unset", "Path to macOS SDK (setting it to 'bundled' indicates that the sdk is expected to be in the container) [required]") // flags used only in release mode flagSet.StringVar(&flags.Category, "category", "", "The category of the app for store listing") @@ -237,6 +237,12 @@ func (cmd *darwin) setupContainerImages(flags *darwinFlags, args []string) error image.SetEnv("CGO_LDFLAGS", "--sysroot /sdk -F/System/Library/Frameworks -L/usr/lib") image.SetEnv("GOOS", "darwin") + if v, ok := ctx.Env["GOFLAGS"]; ok { + ctx.Env["GOFLAGS"] = strings.TrimSpace(v + " -ldflags=-extldflags -ldflags=-lresolv") + } else { + ctx.Env["GOFLAGS"] = "-ldflags=-extldflags -ldflags=-lresolv" + } + if !cmd.localBuild { if flags.MacOSXSDKPath == "unset" { // This is checking if the provided container image has the macOSX SDK installed diff --git a/internal/command/ios.go b/internal/command/ios.go index ac40274..f2e2735 100644 --- a/internal/command/ios.go +++ b/internal/command/ios.go @@ -3,6 +3,7 @@ package command import ( "fmt" "runtime" + "strings" "github.com/fyne-io/fyne-cross/internal/log" "github.com/fyne-io/fyne-cross/internal/volume" @@ -158,6 +159,12 @@ func (cmd *iOS) setupContainerImages(flags *iosFlags, args []string) error { return err } + if v, ok := ctx.Env["GOFLAGS"]; ok { + ctx.Env["GOFLAGS"] = strings.TrimSpace(v + " -ldflags=-extldflags -ldflags=-lresolv") + } else { + ctx.Env["GOFLAGS"] = "-ldflags=-extldflags -ldflags=-lresolv" + } + cmd.Images = append(cmd.Images, runner.createContainerImage("", iosOS, overrideDockerImage(flags.CommonFlags, iosImage))) return nil diff --git a/internal/command/kubernetes.go b/internal/command/kubernetes.go index 594290f..3c0ff8b 100644 --- a/internal/command/kubernetes.go +++ b/internal/command/kubernetes.go @@ -151,6 +151,7 @@ func (i *kubernetesContainerImage) close() error { } func (i *kubernetesContainerImage) Run(vol volume.Volume, opts options, cmdArgs []string) error { + log.Debug(opts.WorkDir, cmdArgs) return i.pod.Run(opts.WorkDir, cmdArgs) } @@ -228,6 +229,8 @@ func (i *kubernetesContainerImage) Prepare() error { name := fmt.Sprintf("fyne-cross-%s-%x", i.ID(), unique) namespace := i.runner.namespace + log.Debug("Creating pod", name, namespace, i.DockerImage, mount, env) + i.pod, err = i.runner.client.NewPod(context.Background(), name, i.DockerImage, namespace, i.runner.storageLimit, i.runner.vol.WorkDirContainer(), mount, env)