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

Reorganize Makefile to build ARM binaries for ddev and stop using build-tools, fixes #2507, for #2338, fixes #2322 #2474

Merged
merged 37 commits into from
Sep 27, 2020

Conversation

rfay
Copy link
Member

@rfay rfay commented Aug 22, 2020

The Problem/Issue/Bug:

This builds linux_amd64, linux_arm, windows_arm.

We can't build darwin_arm64 yet, and windows_arm64 is not on the tool list. (go tool dist list)

See checklist in #2507

How this PR Solves The Problem:

Manual Testing Instructions:

Automated Testing Overview:

Related Issue Link(s):

Release/Deployment notes:

@rfay
Copy link
Member Author

rfay commented Aug 22, 2020

@rfay
Copy link
Member Author

rfay commented Aug 23, 2020

Probably the best path forward for now, especially this week is to manually build versions of this. You can set the images+tags used in pkg/version/version.go, and that's the only way to change ddev-ssh-agent and ddev-router.

https://github.com/drud/ddev/blob/6f01a2d65449da1fedc37aeb4cdc52c547c57419/pkg/version/version.go#L47-L70

Build ddev binaries with make linux_arm64 or make windows_arm (windows/arm64 is not supported by the golang toolchain at this point, not sure why).

@rfay
Copy link
Member Author

rfay commented Aug 31, 2020

I updated this to temporarily use @dennisameling 's images in version.go, so it will start to work (without db container at this point).

Artifacts are at https://app.circleci.com/pipelines/github/drud/ddev/2683/workflows/ce711e0e-e277-41d0-ac43-ba94bc27216e/jobs/27268/artifacts

@rfay
Copy link
Member Author

rfay commented Aug 31, 2020

@rfay
Copy link
Member Author

rfay commented Sep 18, 2020

@dennisameling one thing I note that I hope won't discourage you. windows/arm64 is not listed as a target in go tool dist list, although windows/arm is there. Compiling for windows/arm isn't hard, but results in 32-bit AFAICT, see https://medium.com/@tux0010/compile-golang-for-arm64-on-an-arm64-machine-7a86c133430e

Also, https://build.golang.org/ does not show windows/arm as a currently built version. golang/go#26148 (comment) questions whether it has been abandoned, with no response.

Important resources for building:

@rfay rfay changed the title First attempt at building ARM64 and ARM binaries for ddev First attempt at building ARM64 and ARM binaries for ddev, fixes #2507 Sep 18, 2020
@rfay rfay changed the title First attempt at building ARM64 and ARM binaries for ddev, fixes #2507 Reorganize Makefile to build ARM binaries for ddev and stop using build-tools, fixes #2507, for #2338, for #2322 Sep 18, 2020
@rfay rfay force-pushed the 20200822_arm64 branch 2 times, most recently from 124ae50 to 75333e2 Compare September 19, 2020 00:46
@dennisameling
Copy link
Collaborator

@rfay I don't think a DDEV executable for Windows arm64 should be a priority right now, as I expect most users to be working in WSL2 which uses arm64 Linux executables anyway. Windows arm64 can also run 32-bit applications, so if we could somehow get a x86 or ARM32 executable, that'd suffice for now :)

@rfay
Copy link
Member Author

rfay commented Sep 21, 2020

Ah, glad to hear it! Thanks @dennisameling

@rfay rfay marked this pull request as ready for review September 21, 2020 19:14
@rfay
Copy link
Member Author

rfay commented Sep 25, 2020

@dennisameling I think all the boxes are checked now. In some ways it's better than it's ever been, but in other ways it has so far to go.

Copy link
Collaborator

@dennisameling dennisameling left a comment

Choose a reason for hiding this comment

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

I have the feeling that windows-arm won't work (at least it didn't work with mkcert, application crashed). Could we do windows-386 (32-bit) for the time being until go supports arm64? 32-bit works through emulation on Windows arm64 :)

cp ddev_windows_installer*.exe $ARTIFACTS
# generate windows-arm tarball/zipball
pushd $BASE_DIR/.gotmp/bin/windows_arm
curl -sSL -o mkcert.exe https://github.com/drud/mkcert/releases/download/${MKCERT_VERSION}/mkcert-${MKCERT_VERSION}-windows-arm.exe
Copy link
Collaborator

Choose a reason for hiding this comment

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

windows-arm is not part of the 1.4.4 release: https://github.com/drud/mkcert/releases. I tried with windows-arm but it doesn't seem to work on arm64. i386 (32-bit) does work however (32-bit emulation on arm64). So please:

  • Update mkcert version to v1.4.6 (just released)
  • use -windows-386.exe on windows-arm :)

Copy link
Member Author

Choose a reason for hiding this comment

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

So you want windows/386 (See go tool dist list) ? I wonder if that will work without building 32-bit versions of the images? It may not be worth fighting this, of course. I was hoping that the windows-arm would work on your machine.

I agree about pull windows/arm out of there. But do you think it's useful to have windows/i386?

Copy link
Collaborator

@dennisameling dennisameling Sep 25, 2020

Choose a reason for hiding this comment

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

That would be windows/386 indeed. Thing is, Windows arm64 doesn't even have the ability to run Docker Desktop (docker/roadmap#91), so it's actually a waste of effort for now. Users of Windows arm64 will need to be doing everything from within WSL2, so they'll be using DDEV Linux arm64 binaries in that case. Let's just remove windows_arm and reconsider in a few months 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, I guess I didn't understand how you're running docker on your surface device. You must be running Linux docker inside WSL2?

I've removed windows/arm

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, correct :) no other way to run Docker currently on arm64 Windows devices 😊

Copy link
Member Author

Choose a reason for hiding this comment

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

I sure hear another blog post coming! :)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Haha, so much to blog about after this whole experience! Def will write something soon 🚀

Copy link
Member Author

Choose a reason for hiding this comment

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

We may want to collaborate on a single blog that explains windows/arm64, linux/arm64, raspberry pi/arm64, raspberry pi/arm. /cc @ekl1773

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes sounds good!

@rfay rfay changed the title Reorganize Makefile to build ARM binaries for ddev and stop using build-tools, fixes #2507, for #2338, for #2322 Reorganize Makefile to build ARM binaries for ddev and stop using build-tools, fixes #2507, for #2338, fixes #2322 Sep 25, 2020
@rfay
Copy link
Member Author

rfay commented Sep 25, 2020

Doggone it @dennisameling I just now discovered that the library/mariadb upstream images have no arm/v7 builds.

@dennisameling
Copy link
Collaborator

That's a shame regarding MariaDB :( hope they'll add such image soon!

@rfay rfay merged commit d4abadf into ddev:master Sep 27, 2020
@rfay rfay deleted the 20200822_arm64 branch September 27, 2020 16:47
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.

Reorganize Makefile/build to support multiple architectures, remove use of build-tools (main binary build)
2 participants