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

enable build on Arm64 #4809

Closed
wants to merge 1 commit into from
Closed

enable build on Arm64 #4809

wants to merge 1 commit into from

Conversation

lubinsz
Copy link
Contributor

@lubinsz lubinsz commented Oct 22, 2018

Signed-off-by: Bin Lu [email protected]

Build for Linux on Arm.
Fix 2 issues:
1, luajit 2.0 does not support for arm/ppc64le
2, fix a bug in source/exe/signal_action.cc

Please see log as reference:

A.
root@entos-thunderx2-02:/go/lubinsz/envoy# uname -m
aarch64
B.
root@entos-thunderx2-02:/go/lubinsz/envoy# bazel build //source/exe:envoy-static

INFO: Analysed target //source/exe:envoy-static (1 packages loaded).
INFO: Found 1 target...
Target //source/exe:envoy-static up-to-date:
bazel-bin/source/exe/envoy-static
INFO: Elapsed time: 26.244s, Critical Path: 7.64s
INFO: 3 processes: 3 linux-sandbox.
INFO: Build completed successfully, 6 total actions
C.
root@entos-thunderx2-02:/go/lubinsz/envoy# file bazel-bin/source/exe/envoy-static
bazel-bin/source/exe/envoy-static: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, BuildID[sha1]=bde20afe9d93c34411f43a50468426e8ac996df9, not stripped

Risk Level: Medium

Testing: unit test,integration

Docs Changes: None

Release Notes: None

@lubinsz lubinsz mentioned this pull request Oct 22, 2018
@moderation
Copy link
Contributor

I'm building with unpatched Bazel and rules_go on Arm64 without issue. I compile out Luajit with the diff below. I guess it would be nice to have the Lua capability.

diff --git a/WORKSPACE b/WORKSPACE
index 32547b75..a3bb33d0 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -3,7 +3,9 @@ workspace(name = "envoy")
 load("//bazel:repositories.bzl", "envoy_dependencies", "GO_VERSION")
 load("//bazel:cc_configure.bzl", "cc_configure")

-envoy_dependencies()
+envoy_dependencies(
+    skip_targets=['luajit']
+)
 cc_configure()

@dnoe
Copy link
Contributor

dnoe commented Oct 22, 2018

@lubinsz
Copy link
Contributor Author

lubinsz commented Oct 23, 2018

@moderation
The build will still be failed based on your modifications. Please see following as reference:

A.
root@entos-thunderx2-02:/go/envoyproxy/envoy# git diff
diff --git a/WORKSPACE b/WORKSPACE
index 32547b75..4bac71d3 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -3,7 +3,9 @@ workspace(name = "envoy")
load("//bazel:repositories.bzl", "envoy_dependencies", "GO_VERSION")
load("//bazel:cc_configure.bzl", "cc_configure")

-envoy_dependencies()
+envoy_dependencies(

  •   skip_targets=['luajit']
    

+)
cc_configure()

B.
root@entos-thunderx2-02:/go/envoyproxy/envoy# bazel build //source/exe:envoy-static

DEBUG: /root/gopath/src/github.com/envoyproxy/envoy/bazel/repositories.bzl:93:5: External dep build exited with return code: 0
ERROR: /root/gopath/src/github.com/envoyproxy/envoy/source/extensions/filters/common/lua/BUILD:11:1: no such target '//external:luajit': target 'luajit' not declared in package 'external' defined by /root/gopath/src/github.com/envoyproxy/envoy/WORKSPACE and referenced by '//source/extensions/filters/common/lua:lua_lib'
ERROR: Analysis of target '//source/exe:envoy-static' failed; build aborted: Analysis failed
INFO: Elapsed time: 5.403s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (291 packages loaded)

Signed-off-by: Bin Lu <[email protected]>
@dnoe
Copy link
Contributor

dnoe commented Oct 23, 2018

CircleCI is failing due to some LuaJIT header not found.

@moderation
Copy link
Contributor

@lubinsz In addition to the WORKSPACE modification I compile out unwanted extensions including Lua. My .bazelrc contains build --override_repository=envoy_build_config=~/Library/envoy/build.

~/Library/envoy/build/extensions_build_config.bzl has the following line commented out:

# "envoy.filters.http.lua": "//source/extensions/filters/http/lua:config",

I've been compiling successfully like this without modifications to Bazel since the PGV and rules_go dependencies were updated.

However obviously this doesn't satisfy the scenario where Lua scripting is required for arm64.

@stale
Copy link

stale bot commented Oct 30, 2018

This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@stale stale bot added the stale stalebot believes this issue/PR has not been touched recently label Oct 30, 2018
@mattklein123
Copy link
Member

@lubinsz I don't have any objection to this change (upgrading Lua) but if you want to merge it will need to pass CI. Can you take a look?

@stale stale bot removed the stale stalebot believes this issue/PR has not been touched recently label Oct 30, 2018
@mattklein123 mattklein123 self-assigned this Oct 30, 2018
@mattklein123
Copy link
Member

Marking is waiting.

/wait

@stale
Copy link

stale bot commented Nov 11, 2018

This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@stale stale bot added the stale stalebot believes this issue/PR has not been touched recently label Nov 11, 2018
@stale
Copy link

stale bot commented Nov 18, 2018

This pull request has been automatically closed because it has not had activity in the last 14 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@stale stale bot closed this Nov 18, 2018
@lubinsz
Copy link
Contributor Author

lubinsz commented Nov 29, 2018

@mattklein123
Hi mattklein123 ,
Sorry for late.

The reason for the failure is that,CircleCI use the docker image to compile it, not use the command of 'bazel build //source/exe:envoy-static'.
The reason is that, in docker image of 'envoyproxy/envoy-build-ubuntu' , it only contains luajit-2.0.
If you use the command of 'bazel build //source/exe:envoy-static', bazel will download luajit-2.1 automatically. You can use the command of 'bazel build //source/exe:envoy-static' to check it.

So, there are 1 way to solve this problem, we should update the docker image of 'envoyproxy/envoy-build-ubuntu'.

@mattklein123
Copy link
Member

@lubinsz you will need to do this in a 2-phase commit. You might need to add luajit-2.1 to the build container, we can submit that, then you can do a 2nd commit to delete luajit-2.0, swap the build container, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale stalebot believes this issue/PR has not been touched recently waiting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants