Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

feat(arm): Add build and install support for armv6 and arm64 #2102

Merged
merged 1 commit into from
Feb 17, 2019
Merged

feat(arm): Add build and install support for armv6 and arm64 #2102

merged 1 commit into from
Feb 17, 2019

Conversation

karlskewes
Copy link
Contributor

On path to close #1807 on oauth2_proxy arm support

Tested:

  • Building armv6 and arm64 binaries on amd64
  • Running arm binaries
  • Using armv6 binary on RPi 3B to build another project oauth2_proxy
    (dep ensure)

Not verified:

  • Install script completes as binaries not published, looks okay
    though.
  • hack/test.bash - must have missed something.

armv6 (RPi 3B):

karl@pi1:~/go/src/github.com/pusher/oauth2_proxy $ dep version
dep:
 version     : v0.5.0-31-g73b3afef-dirty
 build date  : 2019-02-01
 git hash    : 73b3afef
 go version  : go1.11.5
 go compiler : gc
 platform    : linux/arm
 features    : ImportDuringSolve=false

karl@pi1:~/go/src/github.com/pusher/oauth2_proxy $ make dep
dep ensure --vendor-only

karl@pi1:~/go/src/github.com/pusher/oauth2_proxy $ uname -m
armv7l

karl@pi1:~ $ ./install.sh
ARCH = arm
OS = linux
Will install into /home/karl/go/bin
Fetching https://github.com/golang/dep/releases/latest..
Release Tag = v0.5.0
Fetching https://github.com/golang/dep/releases/tag/v0.5.0..
Fetching https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-arm..
Request failed with code 404

karl@pi1:~ $ ./test.bash
go test: -race is only supported on linux/amd64, linux/ppc64le, freebsd/amd64, netbsd/amd64, darwin/amd64 and windows/amd64

arm64 (Rock64):

rock64@k8s-w-01:~$ ./dep-linux-arm64 version
dep:
 version     : v0.5.0-31-g73b3afef-dirty
 build date  : 2019-02-01
 git hash    : 73b3afef
 go version  : go1.11.5
 go compiler : gc
 platform    : linux/arm64
 features    : ImportDuringSolve=false

rock64@k8s-w-01:~$ uname -m
aarch64

rock64@k8s-w-01:~$ ./install.sh
ARCH = arm64
OS = linux
Will install into /home/rock64/go/bin
Fetching https://github.com/golang/dep/releases/latest..
Release Tag = v0.5.0
Fetching https://github.com/golang/dep/releases/tag/v0.5.0..
Fetching https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-arm64..
Request failed with code 404

What does this do / why do we need it?

What should your reviewer look out for in this PR?

Do you need help or clarification on anything?

Which issue(s) does this PR fix?

On path to close #1807 on [oauth2_proxy arm support](oauth2-proxy/oauth2-proxy#16)

Tested:
- Building armv6 and arm64 binaries on amd64
- Running arm binaries
- Using armv6 binary on RPi 3B to build another project [oauth2_proxy](https://github.com/kskewes/oauth2_proxy/tree/build)
  (`dep ensure`)

Not verified:
- Install script completes as binaries not published, looks okay
though.
- `hack/test.bash` - must have missed something.

armv6 (RPi 3B):
```
karl@pi1:~/go/src/github.com/pusher/oauth2_proxy $ dep version
dep:
 version     : v0.5.0-31-g73b3afef-dirty
 build date  : 2019-02-01
 git hash    : 73b3afe
 go version  : go1.11.5
 go compiler : gc
 platform    : linux/arm
 features    : ImportDuringSolve=false

karl@pi1:~/go/src/github.com/pusher/oauth2_proxy $ make dep
dep ensure --vendor-only

karl@pi1:~/go/src/github.com/pusher/oauth2_proxy $ uname -m
armv7l

karl@pi1:~ $ ./install.sh
ARCH = arm
OS = linux
Will install into /home/karl/go/bin
Fetching https://github.com/golang/dep/releases/latest..
Release Tag = v0.5.0
Fetching https://github.com/golang/dep/releases/tag/v0.5.0..
Fetching https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-arm..
Request failed with code 404

karl@pi1:~ $ ./test.bash
go test: -race is only supported on linux/amd64, linux/ppc64le, freebsd/amd64, netbsd/amd64, darwin/amd64 and windows/amd64
```

arm64 (Rock64):
```
rock64@k8s-w-01:~$ ./dep-linux-arm64 version
dep:
 version     : v0.5.0-31-g73b3afef-dirty
 build date  : 2019-02-01
 git hash    : 73b3afe
 go version  : go1.11.5
 go compiler : gc
 platform    : linux/arm64
 features    : ImportDuringSolve=false

rock64@k8s-w-01:~$ uname -m
aarch64

rock64@k8s-w-01:~$ ./install.sh
ARCH = arm64
OS = linux
Will install into /home/rock64/go/bin
Fetching https://github.com/golang/dep/releases/latest..
Release Tag = v0.5.0
Fetching https://github.com/golang/dep/releases/tag/v0.5.0..
Fetching https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-arm64..
Request failed with code 404
```
@googlebot
Copy link
Collaborator

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

1 similar comment
@googlebot
Copy link
Collaborator

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

@karlskewes
Copy link
Contributor Author

I signed it!

@googlebot
Copy link
Collaborator

CLAs look good, thanks!

1 similar comment
@googlebot
Copy link
Collaborator

CLAs look good, thanks!

@rmoriz
Copy link

rmoriz commented Feb 14, 2019

does ARMv6 really work without GOARM being set? https://github.com/golang/go/wiki/GoArm

@karlskewes
Copy link
Contributor Author

From memory GOARM defaults to 6 if GOARCH is arm.
Could be clearer to specify rather than use defaults perhaps.

@kevinburke
Copy link
Collaborator

Alright going to try to merge this to trigger the release, if it fails we can back out and try again

@kevinburke kevinburke merged commit 5ae9d8b into golang:master Feb 17, 2019
kevinburke added a commit that referenced this pull request Apr 10, 2019
In January, #2102 was closed with 5ae9d8b to build ARMv6/7 binaries.
This seems to be working, but there are no release files uploaded to
Github for this architecture, because the wrong filenames are used in
.travis-ci. This PR fixes that.

It must be noted that the dep install script is already modified to
expect a ARMv6/7 binary in the Github releases, so it errors out on
404 instead of emitting a clear error message which it did before:

```
Fetching https://github.com/golang/dep/releases/download/v0.5.1/dep-linux-arm
Request failed with code 404
```

Originally submitted by Github user confiks as #2135.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

We need a dep release for arm64
4 participants