Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker images refactoring #37

Merged
merged 24 commits into from Mar 31, 2021
Merged

Conversation

lucor
Copy link
Member

@lucor lucor commented Mar 18, 2021

This PR ports the refactoring for the docker images done in #34 in order to support the latest versions of Go and macOS SDKs.
Since it introduces several features, it could be useful to merge in develop and make generally available.

Details:

  • Add FreeBSD on arm64 target Add FreeBSD on arm64 target #29
  • Add the darwin-image command to build the darwin docker image
  • Add a dedicated docker image for windows
  • Update Go to v1.16.2
  • Update fyne CLI to v2.0.1
  • Update FreeBSD to v12.2 Add FreeBSD on arm64 target #29
  • Remove darwin 386 target
  • Remove the dependency from the docker/golang-cross image for the base image
  • Refactor docker images layout to ensure compatibility with previous versions of fyne-cross

Docker images available in docker hub for testing:

fyneio/fyne-cross:1.1-base
fyneio/fyne-cross:1.1-base-llvm
fyneio/fyne-cross:1.1-base-freebsd
fyneio/fyne-cross:1.1-android
fyneio/fyne-cross:1.1-linux-arm64
fyneio/fyne-cross:1.1-linux-arm
fyneio/fyne-cross:1.1-linux-386
fyneio/fyne-cross:1.1-freebsd-arm64
fyneio/fyne-cross:1.1-freebsd-amd64
fyneio/fyne-cross:1.1-windows

lucor added 17 commits March 7, 2021 19:08
This commit add support for the darwin arm64 target.

Additionally provides:
- Update Go to v1.16.0
- Update fyne cli to v2.0.1
- Add darwin arm64 target
- Remove darwin 386 target

Fixes fyne-io#33
Refactor docker images layout to ensure compatibility with previous versions of  fyne-cross.

In the details:
- Add FreeBSD on arm64 target fyne-io#29
- Add the `darwin-image` command to build the darwin docker image
- Add a dedicated docker image for windows
- Update Go to v1.16.2
- Update fyne CLI to v2.0.1
- Update FreeBSD to v12.2 fyne-io#29
- Remove darwin 386 target
- Remove the dependency from the docker/golang-cross image for the base image
@andydotxyz
Copy link
Member

Building the darwin image relies on Xcode.dmg. But if this is run on a mac they will be installed so the dmg file is gone but the SDK is available installed. Is there some way it could support both?

When building from macOS the SDK could be already available on the host. This commit adds the `-no-docker` options to build directly from the host using the fyne CLI tool without using any docker image.
@lucor
Copy link
Member Author

lucor commented Mar 19, 2021

Good point, added the no-docker flag, available only for macOS.
When specified fyne-cross will build and package using a local installation of the fyne CLI tool instead of the docker image.

Not 100% sure about the no-docker name for the flag, any suggestion is welcome.

@Jacalz
Copy link
Member

Jacalz commented Mar 20, 2021

Not 100% sure about the no-docker name for the flag, any suggestion is welcome.

Hmm. How about -local, -local-sdk, -local-tools or something along those lines?

Copy link
Member

@Jacalz Jacalz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking really good. Will tests compiling later, but now I just had some suggestion to the docs.

CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
docker/CHANGELOG.md Outdated Show resolved Hide resolved
docker/CHANGELOG.md Outdated Show resolved Hide resolved
@andydotxyz
Copy link
Member

Regarding wrapping the Fyne code in general tries to keep to around 120 Cols, though it’s not enforced.
Navigating long lines in markdown with a cli text editor is painful.

@Jacalz
Copy link
Member

Jacalz commented Mar 20, 2021

I just thought that it can be jarring to read manually wrapped text in some situations (save seen that on some sites), but I now see that GitHub handles it rather well in these situations. Most of my wrapping related comments are probably unnecessary then.

@andydotxyz
Copy link
Member

It's part of the markdown spec that a single newline is not a break in the output content.

lucor and others added 5 commits March 21, 2021 17:26
Co-authored-by: Jacob <Jacalz@users.noreply.github.com>
Co-authored-by: Jacob <Jacalz@users.noreply.github.com>
Co-authored-by: Jacob <Jacalz@users.noreply.github.com>
@Jacalz
Copy link
Member

Jacalz commented Mar 21, 2021

It's part of the markdown spec that a single newline is not a break in the output content.

Oh, yes. Might just have been good old Phanicator having some issues 😅

@lucor
Copy link
Member Author

lucor commented Mar 21, 2021

Thanks for feedback
Latest commits should address your suggestions. Updated to the use the -local flag.

Regarding wrapping the Fyne code in general tries to keep to around 120 Cols, though it’s not enforced.
Navigating long lines in markdown with a cli text editor is painful.

Agree with the above especially with the not enforced in special case (i.e. when improve readibility).
Usually is the IDE plugin that wraps it for me, even if probably these README and CHANGELOG contain some old code not wrapped correctly :-)

Copy link
Member

@Jacalz Jacalz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Building for arm64 does not seem to work. It complains about it not being supported:

~/go/bin/fyne-cross freebsd -arch amd64,arm64 -app-id com.github.jacalz.wormhole-gui -icon internal/assets/icon/icon-512.png
[✗] could not make build context for freebsd OS: arch "arm64" is not supported. Supported: [amd64]

EDIT: I added the arch to the support list and got this error instead:

~/go/bin/fyne-cross freebsd -arch amd64,arm64 -app-id com.github.jacalz.wormhole-gui -icon internal/assets/icon/icon-512.png
[i] Target: freebsd/amd64
[i] Cleaning target directories...
[✓] "bin" dir cleaned: /home/jacob/go/src/github.com/Jacalz/wormhole-gui/fyne-cross/bin/freebsd-amd64
[✓] "dist" dir cleaned: /home/jacob/go/src/github.com/Jacalz/wormhole-gui/fyne-cross/dist/freebsd-amd64
[✓] "temp" dir cleaned: /home/jacob/go/src/github.com/Jacalz/wormhole-gui/fyne-cross/tmp/freebsd-amd64
[i] Checking for go.mod: /home/jacob/go/src/github.com/Jacalz/wormhole-gui/go.mod
[✓] go.mod found
[i] Building binary...
# github.com/go-gl/glfw/v3.3/glfw
In file included from /go/pkg/mod/github.com/go-gl/glfw/v3.3/glfw@v0.0.0-20200625191551-73d3c3675aa3/native_linbsd.go:10:
In file included from /go/pkg/mod/github.com/go-gl/glfw/v3.3/glfw@v0.0.0-20200625191551-73d3c3675aa3/glfw/include/GLFW/glfw3native.h:114:
In file included from /freebsd/usr/local/include/GL/glx.h:32:
/freebsd/usr/local/include/GL/gl.h:56:11: warning: 'GLAPIENTRY' macro redefined [-Wmacro-redefined]
/go/pkg/mod/github.com/go-gl/glfw/v3.3/glfw@v0.0.0-20200625191551-73d3c3675aa3/glfw/include/GLFW/glfw3.h:5863:10: note: previous definition is here
[✓] Binary: /home/jacob/go/src/github.com/Jacalz/wormhole-gui/fyne-cross/bin/freebsd-amd64/wormhole-gui
[i] Packaging app...
[✓] Package: /home/jacob/go/src/github.com/Jacalz/wormhole-gui/fyne-cross/dist/freebsd-amd64/wormhole-gui.tar.gz
[i] Target: freebsd/arm64
[i] Cleaning target directories...
[✓] "dist" dir cleaned: /home/jacob/go/src/github.com/Jacalz/wormhole-gui/fyne-cross/dist/freebsd-arm64
[✓] "temp" dir cleaned: /home/jacob/go/src/github.com/Jacalz/wormhole-gui/fyne-cross/tmp/freebsd-arm64
[✓] "bin" dir cleaned: /home/jacob/go/src/github.com/Jacalz/wormhole-gui/fyne-cross/bin/freebsd-arm64
[i] Checking for go.mod: /home/jacob/go/src/github.com/Jacalz/wormhole-gui/go.mod
[✓] go.mod found
[i] Building binary...
docker: invalid reference format.
See 'docker run --help'.
[✗] exit status 125

@lucor
Copy link
Member Author

lucor commented Mar 28, 2021

mmm weird, the code should be there
@Jacalz could you please check if your local copy is up-to-date with this branch?

@lucor lucor mentioned this pull request Mar 30, 2021
@Jacalz
Copy link
Member

Jacalz commented Mar 30, 2021

mmm weird, the code should be there
@Jacalz could you please check if your local copy is up-to-date with this branch?

Yeah, it very much sounds like I used an order version. Will see if I can test again later today.

@dosgo
Copy link

dosgo commented Mar 30, 2021

How to use this? go get?

@lucor
Copy link
Member Author

lucor commented Mar 30, 2021

How to use this? go get?

cd /tmp
git clone https://github.com/lucor/fyne-io-fyne-cross.git
cd fyne-io-fyne-cross
git checkout docker-images-refactoring
go build

@Jacalz
Copy link
Member

Jacalz commented Mar 30, 2021

How to use this? go get?

cd /tmp
git clone https://github.com/lucor/fyne-io-fyne-cross.git
cd fyne-io-fyne-cross
git checkout docker-images-refactoring
go build

You'd have to run make build-images as well, right?

Copy link
Member

@Jacalz Jacalz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for using the wrong version for testing earlier. This works fine. I can't test FreeBSD arm64 binaries unfortunately as my RPi 4 gets stuck in a boot-loop for some reason when I try to boot FreeBSD on it (RPi4 support is in FreeBSD 13.0 and later).

@lucor
Copy link
Member Author

lucor commented Mar 30, 2021

To test this PR it is not needed. The images should be already available on Docker Hub.

@lucor
Copy link
Member Author

lucor commented Mar 31, 2021

Sorry for using the wrong version for testing earlier. This works fine. I can't test FreeBSD arm64 binaries unfortunately as my RPi 4 gets stuck in a boot-loop for some reason when I try to boot FreeBSD on it (RPi4 support is in FreeBSD 13.0 and later).

No worries, thanks for testing. Going to merge in develop.

@lucor lucor merged commit 578925f into fyne-io:develop Mar 31, 2021
@lucor lucor deleted the docker-images-refactoring branch March 31, 2021 06:59
This was referenced Mar 31, 2021
Jacalz added a commit to Jacalz/rymdport that referenced this pull request Apr 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants