diff --git a/CHANGELOG.md b/CHANGELOG.md index ebac9dc..cf6bea6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,19 @@ # Changelog - Fyne.io fyne-cross -## Unreleased +## 1.4.0 - 13 Mar 2023 + +### Added + +- Add support for Kubernetes +- Add ability to specify a different registry +- Support for fyne metadata + +### Changed + +- Pull image from fyne-cross-image repository +- Simplify `fyne-cross darwin-sdk-extract` by getting the needed files from the Apple SDK and then mounting them in the container image for each build +- Provide a darwin image and mount the SDK from the host +- Use `fyne build` for all targets ## 1.3.0 - 16 Jul 2022 diff --git a/README.md b/README.md index bc00019..0b955d8 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ Supported targets are: > - starting from v1.1.0: > - cross-compile from NOT `darwin` (i.e. linux) to `darwin`: requires a copy of the macOS SDK on the host. The fyne-cross `darwin-sdk-extractor` command can be used to extract the SDK from the XCode CLI Tool file, see the [Extract the macOS SDK](#extract_macos_sdk) section below. > - cross-compile from `darwin` to `darwin` by default will use under the hood the fyne CLI tool and requires Go and the macOS SDK installed on the host. +> - starting from v1.4.0, Arm64 hosts are supported for all platforms except Android. ## Requirements @@ -45,7 +46,7 @@ For go >= 1.16: go install github.com/fyne-io/fyne-cross@latest ``` -To install a fyne-cross with kubernetes engine: +To install a fyne-cross with kubernetes engine support: ``` go install -tags k8s github.com/fyne-io/fyne-cross@latest ``` @@ -88,18 +89,6 @@ The commands are: Use "fyne-cross -help" for more information about a command. ``` -### Apple Arm Silicon special - -On Apple Arm64 architecture, the container have to run in a vm. This vm put some constraint on getting fyne-cross to work in that setup. - -## podman on Mac Mini M1 - -You need to create a `podman machine` that has a short name as the access path on Mac can not be over 104 and that limit can be reached quickly when the machine name is to long. Additionally you need to specify in the machine the path that you might need during your build. An example of possible machine to use: - -``` -podman machine init --now machine --cpus=8 --memory=6096 -v /tmp:/tmp -v ${HOME}:${HOME} -``` - ### Wildcards The `arch` flag support wildcards in case want to compile against all supported GOARCH for a specified GOOS diff --git a/internal/command/context.go b/internal/command/context.go index 706f034..43264de 100644 --- a/internal/command/context.go +++ b/internal/command/context.go @@ -60,6 +60,7 @@ type Context struct { Pull bool // Pull if true attempts to pull a newer version of the docker image NoProjectUpload bool // NoProjectUpload if true, the build will be done with the artifact already stored on S3 NoResultDownload bool // NoResultDownload if true, the result of the build will be left on S3 and not downloaded locally + NoNetwork bool // NoNetwork if true, the build will be done without network access //Build context BuildMode string // The -buildmode argument to pass to go build @@ -142,6 +143,7 @@ func makeDefaultContext(flags *CommonFlags, args []string) (Context, error) { Name: flags.Name, StripDebug: !flags.NoStripDebug, Debug: flags.Debug, + NoNetwork: flags.NoNetwork, Volume: vol, Pull: flags.Pull, Release: flags.Release, diff --git a/internal/command/docker.go b/internal/command/docker.go index 7746db8..e3a8e5b 100644 --- a/internal/command/docker.go +++ b/internal/command/docker.go @@ -27,6 +27,7 @@ type localContainerEngine struct { pull bool cacheEnabled bool + noNetwork bool } func newLocalContainerEngine(context Context) (containerEngine, error) { @@ -39,6 +40,7 @@ func newLocalContainerEngine(context Context) (containerEngine, error) { engine: &context.Engine, pull: context.Pull, cacheEnabled: context.CacheEnabled, + noNetwork: context.NoNetwork, }, nil } @@ -151,6 +153,10 @@ func (i *localContainerImage) cmd(vol volume.Volume, opts options, cmdArgs []str "-e", fmt.Sprintf("GOCACHE=%s", vol.GoCacheDirContainer()), // mount GOCACHE to reuse cache between builds ) + if i.runner.noNetwork { + args = append(args, "--network=none") + } + // add custom env variables args = AppendEnv(args, i.runner.env, i.env["GOOS"] != freebsdOS) args = AppendEnv(args, i.env, i.env["GOOS"] != freebsdOS) diff --git a/internal/command/flag.go b/internal/command/flag.go index 582c623..41aa8dc 100644 --- a/internal/command/flag.go +++ b/internal/command/flag.go @@ -55,6 +55,8 @@ type CommonFlags struct { NoResultDownload bool // NoStripDebug if true will not strip debug information from binaries NoStripDebug bool + // NoNetwork if true will not setup network inside the container + NoNetwork bool // Name represents the application name Name string // Release represents if the package should be prepared for release (disable debug etc) @@ -133,6 +135,7 @@ func newCommonFlags() (*CommonFlags, error) { flagSet.BoolVar(&flags.Debug, "debug", false, "Debug mode") flagSet.BoolVar(&flags.Pull, "pull", false, "Attempt to pull a newer version of the docker image") flagSet.StringVar(&flags.DockerRegistry, "docker-registry", "docker.io", "The docker registry to be used instead of dockerhub (only used with defualt docker images)") + flagSet.BoolVar(&flags.NoNetwork, "no-network", false, "If set, the build will be done without network access") return flags, nil }