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

Build Support for arm/arm64 #553

Merged
merged 1 commit into from
May 20, 2017
Merged

Conversation

akutz
Copy link
Collaborator

@akutz akutz commented May 17, 2017

This patch (related to rexray/rexray#860) updates the Makefile to support building libStorage for the arm and arm64 architectures. From now on executor binaries that follow the pattern lsx-GOOS will have an implicit architecture of amd64. However, executor binaries can now also follow the pattern lsx-GOOS-GOARCH in order to support non-amd64 architectures.

@akutz akutz self-assigned this May 17, 2017
@akutz akutz force-pushed the feature/build-arm-arm64 branch from 9e8d3e3 to 7c53e9e Compare May 17, 2017 19:09
@ghost
Copy link

ghost commented May 18, 2017

Wow, good job @akutz. One big step for ARM!

@akutz
Copy link
Collaborator Author

akutz commented May 18, 2017

Thanks! I still need to update the libStorage client code to request an executor with the GOARCH if not amd64, and I've been trying to get a rpi qemu env online to test the changes.

@akutz akutz force-pushed the feature/build-arm-arm64 branch from 7c53e9e to 906db85 Compare May 18, 2017 16:31
@akutz
Copy link
Collaborator Author

akutz commented May 18, 2017

Hi @naster01,

I can confirm the arm executor does indeed work:

Printing the System Architecture

$ uname -a
Linux retropie 4.4.26-v7+ #915 SMP Thu Oct 20 17:08:44 BST 2016 armv7l GNU/Linux

Running lsx-linux-arm

$ ./lsx-linux-arm 
usage: ./lsx-linux-arm <executor> supported
                                  instanceID
                                  nextDevice
                                  localDevices <scanType>
                                  wait <scanType> <attachToken> <timeout>
                                  mounts
                                  mount [-l label] [-o options] device path
                                  umount path

       executor:    vfs

       scanType:    0,quick | 1,deep

       attachToken: <token>

       timeout:     30s | 1h | 5m

@akutz akutz force-pushed the feature/build-arm-arm64 branch 9 times, most recently from 2b120fa to 676f5b4 Compare May 19, 2017 21:30
@akutz akutz force-pushed the feature/build-arm-arm64 branch 7 times, most recently from bfa4a0c to 646528b Compare May 19, 2017 23:18
@codecov-io
Copy link

codecov-io commented May 19, 2017

Codecov Report

Merging #553 into master will increase coverage by 0.1%.
The diff coverage is 60%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #553     +/-   ##
=========================================
+ Coverage   28.32%   28.42%   +0.1%     
=========================================
  Files          34       34             
  Lines        2009     2016      +7     
=========================================
+ Hits          569      573      +4     
- Misses       1379     1381      +2     
- Partials       61       62      +1
Impacted Files Coverage Δ
api/utils/utils_paths.go 87.5% <60%> (-2.63%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4a54779...8c8aa3e. Read the comment docs.

@akutz akutz force-pushed the feature/build-arm-arm64 branch 2 times, most recently from 37d171c to 65ea1fb Compare May 20, 2017 04:22
This patch updates the Makefile to support building libStorage for the
arm and arm64 architectures. From now on executor binaries that follow
the pattern `lsx-GOOS` will have an implicit architecture of amd64.
However, executor binaries can now also follow the pattern
`lsx-GOOS-GOARCH` in order to support non-amd64 architectures.
@akutz akutz force-pushed the feature/build-arm-arm64 branch from 65ea1fb to 8c8aa3e Compare May 20, 2017 04:34
@akutz akutz merged commit 162d6b9 into thecodeteam:master May 20, 2017
@akutz akutz deleted the feature/build-arm-arm64 branch May 20, 2017 05:10
@ghost
Copy link

ghost commented May 29, 2017

I think I'm building with the correct requirements build-ref.

OS : Linux dnode1 4.4.50-v7+ #970 SMP Mon Feb 20 19:18:29 GMT 2017 armv7l GNU/Linux
Docker ver : 17.05.0-ce
Docker API : 1.29
GNU Make : 4.0
Git : 2.1.4
naster@dnode1:~/Sources/libstorage $ git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean

Are there any args?

naster@dnode1:~/Sources/libstorage $ sudo make
make docker-build
make[1]: Entering directory '/home/naster/Sources/libstorage'
Error response from daemon: Container 41b589a0074dfb20cea48997e3dc7e36b4b08895799db43efdeed7ca6cc0890c is not running
Makefile:215: recipe for target 'docker-init' failed
make[1]: *** [docker-init] Error 1
make[1]: Leaving directory '/home/naster/Sources/libstorage'
Makefile:30: recipe for target 'all' failed
make: *** [all] Error 2

naster@dnode1:~/Sources/libstorage $ sudo GOOS=linux GOARCH=arm64 make
make docker-build
make[1]: Entering directory '/home/naster/Sources/libstorage'
Error response from daemon: Container 41b589a0074dfb20cea48997e3dc7e36b4b08895799db43efdeed7ca6cc0890c is not running
Makefile:215: recipe for target 'docker-init' failed
make[1]: *** [docker-init] Error 1
make[1]: Leaving directory '/home/naster/Sources/libstorage'
Makefile:30: recipe for target 'all' failed
make: *** [all] Error 2

Syslog

May 29 18:41:48 dnode1 dockerd[728]: time="2017-05-29T18:41:48.194841858Z" level=error msg="Error setting up exec command in container build-libstorage: Container 41b589a0074dfb20cea48997e3dc7e36b4b08895$
May 29 18:41:48 dnode1 dockerd[728]: time="2017-05-29T18:41:48.195051857Z" level=error msg="Handler for POST /v1.29/containers/build-libstorage/exec returned error: Container 41b589a0074dfb20cea48997e3dc$

Docker logs

standard_init_linux.go:178: exec user process caused "exec format error"

Well I'm gonna wait for bins or rexray's docker plugin I think.

@akutz
Copy link
Collaborator Author

akutz commented May 29, 2017

Hi @naster01,

You're building outside of a GOPATH, and that isn't supported when building Go programs. However, since you're using Docker it should be fine. Look at the reported error:

Error response from daemon: Container 41b589a0074dfb20cea48997e3dc7e36b4b08895799db43efdeed7ca6cc0890c is not running

You've got an old container that is stopped and preventing the build. Use the docker-clobber target from the documentation to clean up stale containers.

Also, you're setting GOOS and GOARCH, but those are not the correct values to set for the Docker build. I again refer you to the documentation for build options.

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

Successfully merging this pull request may close these issues.

2 participants