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

all: port to Windows/arm64 #36439

Open
vielmetti opened this issue Jan 7, 2020 · 37 comments
Open

all: port to Windows/arm64 #36439

vielmetti opened this issue Jan 7, 2020 · 37 comments

Comments

@vielmetti
Copy link

@vielmetti vielmetti commented Jan 7, 2020

Opening this issue to track interest and progress in a port to windows/arm64.

This is completely separate from the open issue #26148 (windows/arm32) but might be informed by it.

The specific codebase I'm motivated by for this request is for WireguardVPN, and the specific discussion to reference is https://lists.zx2c4.com/pipermail/wireguard/2020-January/004832.html & surrounding.

@ALTree ALTree added the OS-Windows label Jan 8, 2020
@toothrot toothrot added this to the Backlog milestone Jan 8, 2020
@carlosedp
Copy link

@carlosedp carlosedp commented Jan 11, 2020

What is the best option for hardware to run Windows on arm64? Does it run on a RK3399 SoC board like the Pine64 Pro?

@vielmetti
Copy link
Author

@vielmetti vielmetti commented Jan 11, 2020

@carlosedp All of the Windows 10 on Arm laptops that I am aware of to date are Qualcomm Snapdragon based. My daily driver laptop is a Lenovo Yoga C630, and there's a relatively new Microsoft Surface Pro X with a faster chip.

It looks like some work to get the boot sequence for rk3399 boards compatible with Windows lives at https://github.com/andreiw/rk3399-edk2 by @andreiw - with liberal warnings of things that still don't work.

@driver1998
Copy link

@driver1998 driver1998 commented Jan 12, 2020

It can also run on KVM, I actually do my ARM64 dev on a KVM VM on RK3399.

@clarkezone
Copy link

@clarkezone clarkezone commented Jan 20, 2020

I would love to see an ARM64 version of go for Windows 10 so I can run it natively on the Surface Pro X:
image

Is what I'm currently seeing so it won't even run in emulation on this device or so it would seem.

@necrose99
Copy link

@necrose99 necrose99 commented Feb 13, 2020

#25084 same deal.

@necrose99
Copy link

@necrose99 necrose99 commented Feb 13, 2020

mitchellh/gox#140
platform.go and a few hax... latter.
https://github.com/golang/winstrap
ahh poohh but did not get an arm64 windows-arm build of gox... how nice.
winstrap-master_windows_arm.zip

might help...

@backerman
Copy link

@backerman backerman commented Feb 21, 2020

I would love to see an ARM64 version of go for Windows 10 so I can run it natively on the Surface Pro X:
image

Is what I'm currently seeing so it won't even run in emulation on this device or so it would seem.

Did you use the 32- or 64- bit download? The 32-bit x86 version should run in emulation.

@necrose99
Copy link

@necrose99 necrose99 commented Feb 21, 2020

my windows wants is any golang honeypots and RPI3/4 makes for good decoys/bait...
/topSec SBC's are less expensive to utilize emulation meh..

@anaisbetts
Copy link

@anaisbetts anaisbetts commented Mar 2, 2020

@clarkezone fwiw, the 32-bit x86 version of Go's installer seems to work, at least from my limited testing (I'm not a Go user, I just wanted to build a Go app)

@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Mar 2, 2020

Reposting @anaisbetts's comment from elsewhere:

So, one thing to know about ARM64 on Windows is, it actually fully emulates x86 (not amd64, 32-bit apps oddly enough) for user-space apps - they Just Work (most of the time! kinda!)

So, with a bit of sleight-of-hand packaging, you can make an "ARM64" release that still mostly has x86 binaries

(I'm not sure what the performance cost of that is, though.)

@zx2c4
Copy link
Contributor

@zx2c4 zx2c4 commented May 13, 2020

One reason why windows/arm isn't sufficient is that several important APIs -- such as all of setupapi.dll, for example -- are unavailable in wow mode, which means we need actual arm64 binaries.

It's quite possible to get windows running on arm64 in qemu, by the way.

@taxilian
Copy link

@taxilian taxilian commented Jun 6, 2020

I'd love to see this as well, wanting to build some tools for my surface pro x

@zx2c4
Copy link
Contributor

@zx2c4 zx2c4 commented Jun 7, 2020

@jstarks Any word on this?

@jstarks
Copy link

@jstarks jstarks commented Jun 7, 2020

We (the OS team at Microsoft) would love to see this, too, and we would be open to contributing the code for the port. Unfortunately, we're not in a position to commit to long-term maintenance of the code or associated builder right now, so we are hesitant to send out any patches.

If Google or the Golang community would be interested in taking on the ongoing maintenance cost, we would be happy to collaborate on the development.

@zx2c4
Copy link
Contributor

@zx2c4 zx2c4 commented Jun 7, 2020

@jstarks Just like we (Alex, me, Google employees) are already helping to maintain the other 3 Windows ports (386, amd64, arm), I don't see any reason why we couldn't do the same for arm64. I've got Windows running in QEMU/arm64 now for Wintun development, and that works well.

@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Jun 7, 2020

@jstarks Just like we (Alex, me, Google employees) are already helping to maintain the other 3 Windows ports (386, amd64, arm), I don't see any reason why we couldn't do the same for arm64.

windows/arm is actually a counterexample. Its builder disappeared and it bit rot. We're not not even sure it works anymore. There have been reports it doesn't.

In any case, @jstarks, the builders are the main issue, more than maintenance. If we have reliable & plentiful builders, the Go team & community can help keep it working. But absent builders it'll just rot.

How does Microsoft test? Does windows/arm{,64} run on Azure perhaps?

@zx2c4
Copy link
Contributor

@zx2c4 zx2c4 commented Jun 7, 2020

windows/arm is actually a counterexample. Its builder disappeared and it bit rot. We're not not even sure it works anymore. There have been reports it doesn't.

The arm port works. @rozmansi got WireGuard/Wintun ported to it. Unfortunately, WOW has its limitations and we really need arm64 to access the APIs that we need (setupapi.dll, for example).

@zx2c4
Copy link
Contributor

@zx2c4 zx2c4 commented Jun 7, 2020

How does Microsoft test? Does windows/arm{,64} run on Azure perhaps?

I'd too be interested to learn if Microsoft has some nice solutions for this.

But in case not, @rozmansi and I can probably help getting the QEMU setup via TCG running smoothly in gcloud like the current set of builders. Or if we actually need additional performance, we could look if ec2's arm64 VMs support nested KVM, or grab a ThunderX machine from Scaleway and run KVM over there.

@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Jun 7, 2020

The arm port works.

On which branch? Go 1.14 only or even master? (And the fact that we even have to ask is a ridiculous situation to be in.)

@zx2c4
Copy link
Contributor

@zx2c4 zx2c4 commented Jun 7, 2020

The arm port works.

On which branch? Go 1.14 only or even master? (And the fact that we even have to ask is a ridiculous situation to be in.)

Haven't looked at git master in sometime. Could give it a whirl I suppose.

@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Jun 7, 2020

But in case not, @rozmansi and I can probably help getting the QEMU setup via TCG running smoothly in gcloud like the current set of builders.

Go is moving towards having all its arm & arm64 builders on Amazon. EC2 has nice ARM instance types nowadays.

If you can get windows/arm and windows/arm64 booting in qemu[/kvm] there, that'd be great. Then it's just a question of Windows licensing, which perhaps @jstarks et al could help with.

@jstarks
Copy link

@jstarks jstarks commented Jun 8, 2020

This sounds promising. I'll check on what options are available and if there are licensing implications.

@zx2c4
Copy link
Contributor

@zx2c4 zx2c4 commented Jun 8, 2020

image

@rozmansi's overall setup works pretty well for me. EC2 doesn't pass down the vmx bit, but TCG really is fast enough for testing things.

@zx2c4
Copy link
Contributor

@zx2c4 zx2c4 commented Jun 10, 2020

@jstarks @bradfitz @alexbrainman @aclements @ianlancetaylor @cherrymui - by now you each should have received @rozmansi's VM image and instructions from me. @bradfitz was the one who suggested we get an arm64 builder up and running, but he doesn't work for Google anymore, so I assume he isn't in a position to put coins in the Go builder EC2/GCP machine. I'm not familiar with how the Go team works enough to @ the right person. Can somebody more knowledgeable about processes lay out the next steps?

@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Jun 10, 2020

@cagedmantis, @toothrot and @dmitshur work on builder stuff.

@zx2c4
Copy link
Contributor

@zx2c4 zx2c4 commented Jun 10, 2020

Great, I'll get the VM info over to them too.

@elachlan
Copy link

@elachlan elachlan commented Jul 11, 2020

Has there been any more progress on this?

@zx2c4
Copy link
Contributor

@zx2c4 zx2c4 commented Jul 11, 2020

@jstarks Specifically, were the actions that Google has begun to take w.r.t. getting the arm builders up sufficient to convince your team that contributing the in-progress arm64 port is worth while?

@cagedmantis
Copy link
Contributor

@cagedmantis cagedmantis commented Jul 13, 2020

@elachlan The release team has been working on preparing the next release. Once we get out of release freeze period we hope to be adding the builders.

@Alovchin91
Copy link

@Alovchin91 Alovchin91 commented Aug 22, 2020

@cagedmantis Have you had time to look into this?

@cagedmantis
Copy link
Contributor

@cagedmantis cagedmantis commented Aug 24, 2020

@Alovchin91 We are working out the licensing. As soon as it's worked out we can move forward by adding the builders.

@mirogl
Copy link

@mirogl mirogl commented Sep 26, 2020

Hi ,
today I found Go for Windows arm64 - https://github.com/thongtech/go-windows-arm64
Does this help to unblock the development ?
Thanks

@ysc3839
Copy link

@ysc3839 ysc3839 commented Sep 26, 2020

@mirogl Looks like that repo has no changes to source code compared to go 1.15.2. Does it means golang already supported windows arm64?

Here is git diff:

$ git status
On branch test
Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        deleted:    .gitattributes
        deleted:    .github/CODE_OF_CONDUCT.md
        deleted:    .github/ISSUE_TEMPLATE
        deleted:    .github/PULL_REQUEST_TEMPLATE
        deleted:    .github/SUPPORT.md
        modified:   .gitignore
        modified:   README.md
        deleted:    lib/time/zoneinfo.zip
        deleted:    src/archive/zip/testdata/crc32-not-streamed.zip
        deleted:    src/archive/zip/testdata/dd.zip
        deleted:    src/archive/zip/testdata/go-with-datadesc-sig.zip
        deleted:    src/archive/zip/testdata/readme.zip
        deleted:    src/archive/zip/testdata/symlink.zip
        deleted:    src/archive/zip/testdata/test-trailing-junk.zip
        deleted:    src/archive/zip/testdata/test.zip
        deleted:    src/archive/zip/testdata/time-22738.zip
        deleted:    src/archive/zip/testdata/time-7zip.zip
        deleted:    src/archive/zip/testdata/time-go.zip
        deleted:    src/archive/zip/testdata/time-infozip.zip
        deleted:    src/archive/zip/testdata/time-osx.zip
        deleted:    src/archive/zip/testdata/time-win7.zip
        deleted:    src/archive/zip/testdata/time-winrar.zip
        deleted:    src/archive/zip/testdata/time-winzip.zip
        deleted:    src/archive/zip/testdata/unix.zip
        deleted:    src/archive/zip/testdata/utf8-7zip.zip
        deleted:    src/archive/zip/testdata/utf8-infozip.zip
        deleted:    src/archive/zip/testdata/utf8-osx.zip
        deleted:    src/archive/zip/testdata/utf8-winrar.zip
        deleted:    src/archive/zip/testdata/utf8-winzip.zip
        deleted:    src/archive/zip/testdata/winxp.zip
        deleted:    src/archive/zip/testdata/zip64-2.zip
        deleted:    src/archive/zip/testdata/zip64.zip

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        bin/
        pkg/
        src/cmd/cgo/zdefaultcc.go
        src/cmd/go/internal/cfg/zdefaultcc.go
        src/cmd/go/internal/cfg/zosarch.go
        src/cmd/internal/objabi/zbootstrap.go
        src/go/build/zcgo.go
        src/runtime/internal/sys/zversion.go

no changes added to commit (use "git add" and/or "git commit -a")
@mirogl
Copy link

@mirogl mirogl commented Sep 26, 2020

@ysc3839 - I don't know - I just found the repo today and the binary package from this page is running fine on my Surface Pro X - https://github.com/thongtech/go-windows-arm64/releases/download/1.15.2/go1.15.2.windows-arm64.zip - when i run "go version" i get "go version go1.15.2 windows/arm" - but yes - it is strange - perhaps the 1.15.2 code is ok, but he used a cross compiler to get it compiled for arm64 - I don't know. I will create an issue and ask.

@ysc3839
Copy link

@ysc3839 ysc3839 commented Sep 26, 2020

@mirogl The binary is arm instead of arm64.

$ file go.exe
go.ex_: PE32 executable (console) ARMv7 Thumb (stripped to external PDB), for MS Windows

An arm64 binary built using MSVC:

$ file TestARM64.exe
TestARM64.exe: PE32+ executable (GUI) Aarch64, for MS Windows
@mirogl
Copy link

@mirogl mirogl commented Sep 26, 2020

Hi @ysc3839 - thanks - I created an issue with your questions - thongtech/go-windows-arm#1
Hopefully he will answer them. Sorry for the confusion - just found the repo and was happy it run on my Surface Pro X and I could als build a go project.

@mirogl
Copy link

@mirogl mirogl commented Sep 26, 2020

Hi @ysc3839 - he responded in the issue I linked below - so he just cross compiled it for arm32 with zero changes on the official code.
Thanks for your hint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
You can’t perform that action at this time.