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

Release artifacts on github don't include arm so file #153

Closed
costinm opened this issue Jun 19, 2019 · 9 comments
Closed

Release artifacts on github don't include arm so file #153

costinm opened this issue Jun 19, 2019 · 9 comments

Comments

@costinm
Copy link

costinm commented Jun 19, 2019

Both linux and mac variants under https://github.com/lyft/envoy-mobile/releases include
jni/x86/libenvoy_jni.so - which likely works under x86 devices and emulator. It would be great if the armeabi library would also be included so it can be run on phone.

Also the JNI is not stripped - would be nice to also have a stripped (rel) variant, seems the size goes from 68 to 54M.

@junr03
Copy link
Member

junr03 commented Jun 19, 2019

Thanks for the issue @costinm! Valid on both fronts.

  1. We have been building against emulators, but will soon start building against physical devices. We will publish arm artifacts soon!
  2. I am currently working on reduce binary size #17 and stripping away symbols will definitely be part of that work.

@rebello95
Copy link
Contributor

Related, the iOS Envoy.framework artifact in the release also doesn't have support for all architectures. Fix here: #155

@costinm
Copy link
Author

costinm commented Jun 21, 2019

It appears that building from source does create the right jni.

BTW - it would be great to copy an updated "run_envoy_docker.sh" from envoy to envoy-mobile, it seems the most reliable and frustration-free way to build.

I used:

docker run -it --rm -v `pwd`:`pwd` -w `pwd` \
    -v $ANDROID_HOME:/Android -v $ANDROID_NDK_HOME:/AndroidNDK \
    -e ANDROID_HOME=/Android -e ANDROID_NDK_HOME=/AndroidNDK \
    --name envoy envoyproxy/envoy-build:ec38ecb88fd1abe55ab1daa2f6bd239ffccc9d98 

The arm binary is also smaller (67M x86 vs 57M arm unstripped). Seems to go down to 42M stripped.

@costinm
Copy link
Author

costinm commented Jul 8, 2019

I did a fresh build - and it appears the arm no long shows in in the .ear file.
Is there any new option to generate arm ?

@costinm
Copy link
Author

costinm commented Jul 9, 2019

It seems worse - on a second machine, where I previously built the arm binaries, using the exact same command I get build errors. I'm starting to suspect the android SDK or NDK are different, and somehow
the NDK I used on the machine that worked for arm is confusing bazel.

Starting local Bazel server and connecting to it...
ERROR: /root/.cache/bazel/_bazel_root/1512acf4df716dad75482ca507bdf0de/external/envoy/source/exe/BUILD:33:1: Label '@envoy//source/extensions/transport_sockets/tls:config' is duplicated in the 'deps' attribute of rule 'envoy_common_lib'
INFO: Call stack for the definition of repository 'remote_java_tools_linux' which is a http_archive (rule definition at /root/.cache/bazel/_bazel_root/1512acf4df716dad75482ca507bdf0de/external/bazel_tools/tools/build_defs/repo/http.bzl:229:16):
 - /DEFAULT.WORKSPACE.SUFFIX:229:1
INFO: Call stack for the definition of repository 'android_tools' which is a http_archive (rule definition at /root/.cache/bazel/_bazel_root/1512acf4df716dad75482ca507bdf0de/external/bazel_tools/tools/build_defs/repo/http.bzl:229:16):
 - /DEFAULT.WORKSPACE.SUFFIX:267:1
INFO: Call stack for the definition of repository 'remotejdk11_linux' which is a http_archive (rule definition at /root/.cache/bazel/_bazel_root/1512acf4df716dad75482ca507bdf0de/external/bazel_tools/tools/build_defs/repo/http.bzl:229:16):
 - /DEFAULT.WORKSPACE.SUFFIX:199:1
INFO: Call stack for the definition of repository 'com_github_jetbrains_kotlin' which is a http_archive (rule definition at /root/.cache/bazel/_bazel_root/1512acf4df716dad75482ca507bdf0de/external/bazel_tools/tools/build_defs/repo/http.bzl:229:16):
 - /root/.cache/bazel/_bazel_root/1512acf4df716dad75482ca507bdf0de/external/io_bazel_rules_kotlin/kotlin/internal/repositories/repositories.bzl:64:5
 - /ws/envoy-mobile/WORKSPACE:134:1
INFO: Call stack for the definition of repository 'com_github_fmtlib_fmt' which is a http_archive (rule definition at /root/.cache/bazel/_bazel_root/1512acf4df716dad75482ca507bdf0de/external/bazel_tools/tools/build_defs/repo/http.bzl:229:16):
 - /root/.cache/bazel/_bazel_root/1512acf4df716dad75482ca507bdf0de/external/envoy_api/bazel/envoy_http_archive.bzl:18:5
 - /root/.cache/bazel/_bazel_root/1512acf4df716dad75482ca507bdf0de/external/envoy/bazel/repositories.bzl:24:5
 - /root/.cache/bazel/_bazel_root/1512acf4df716dad75482ca507bdf0de/external/envoy/bazel/repositories.bzl:233:5
 - /root/.cache/bazel/_bazel_root/1512acf4df716dad75482ca507bdf0de/external/envoy/bazel/repositories.bzl:133:5
 - /ws/envoy-mobile/WORKSPACE:54:1
ERROR: /ws/envoy-mobile/library/common/BUILD:7:1: Target '@envoy//source/exe:envoy_main_common_lib' contains an error and its package is in error and referenced by '//library/common:envoy_main_interface_lib'
ERROR: Analysis of target '//:android_dist' failed; build aborted: Cannot compute config conditions
INFO: Elapsed time: 23.522s
INFO: 0 processes.

@costinm
Copy link
Author

costinm commented Jul 9, 2019

I verified that on both machines the ndk is identical.
The sdk on the machine that doesn't build has additional build tools - 29.0.0.rc1/2
and android-27 and android-Q platforms added.

I'm running the builds in a docker, confirmed that git is at same SHA.

The joy of using bazel for 'reproducible builds'...

@costinm
Copy link
Author

costinm commented Jul 10, 2019

Some update: on the same machine I tried older SHAs.
45d1413 - worked and generated ARM binaries.
24ba3e2 - works but only generates x86
2f3b0be - is the one where the bazel errors showed up.

I'll try to find the last version that still generates ARM, since I'm mainly testing on devices.

@costinm
Copy link
Author

costinm commented Jul 11, 2019

Never mind - found the change, it seems the bazel target changed to 'device' instead of android.
And head seems to compile again after removing everything and fresh checkout, I suspect some leftovers.

@costinm costinm closed this as completed Jul 11, 2019
@buildbreaker
Copy link

@costinm Thanks for the update here. I'm glad that you were able to figure out what the issue is :)

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

No branches or pull requests

4 participants