Jenkins Android build fails - can't build libwebviewchromium.so
Asked Answered
H

4

8

A bit of advice or idea is needed.

I am trying to build Android 5.1.1 Lollipop with Jenkins. But it fails to build libwebviewchromium.so:

...
out/target/product/generic/obj/GYP/shared_intermediates/blink/bindings/core/v8/V8SVGNumber.cpp:55: error: undefined reference to 'blink::SVGNumberTearOff::setValue(float, blink::ExceptionState&)'
out/target/product/generic/obj/STATIC_LIBRARIES/third_party_WebKit_Source_core_webcore_generated_gyp_intermediates/SVGElementFactory.cpp:383: error: undefined reference to 'blink::SVGMetadataElement::create(blink::Document&)'
external/chromium_org/third_party/WebKit/Source/core/svg/SVGNumberTearOff.h:45: error: undefined reference to 'blink::SVGNumberTearOff::SVGNumberTearOff(WTF::PassRefPtr<blink::SVGNumber>, blink::SVGElement*, blink::PropertyIsAnimValType, blink::QualifiedName const&)'
collect2: error: ld returned 1 exit status
make: *** [out/target/product/generic/obj/SHARED_LIBRARIES/libwebviewchromium_intermediates/LINKED/libwebviewchromium.so] Error 1

At the same time, when I try to build it manually, it succeeds:

. build/envsetup.sh
set_stuff_for_environment
lunch zh2_qemu_eng
make clean
make -j24

I wonder how it comes that the same operation can be successful when using a console and fail when using Jenkins. Could you please share your ideas with me?

P.S. The build machine has 24GB of RAM and 15GB swap file, and a 512 GB SSD flash disk (62% available). The OS is Ubuntu 14.04LTS, 64 bit.

$ free -m
             total       used       free     shared    buffers     cached
Mem:         24021      22079       1942         75       4778       8768
-/+ buffers/cache:       8532      15488
Swap:        16036        345      15691
Hayashi answered 12/12, 2018 at 19:19 Comment(0)
H
1

The problem is solved. We copied the Jenkins/AOSP setup from another server, and something was wrong with the copy. The cleanup of the ccache solved the problem. After performing "ccache -c" command, everything worked fine.

Hayashi answered 18/1, 2019 at 12:27 Comment(0)
V
5

I wonder how it comes that the same operation can be successful when using a console and fail when using Jenkins.

Because Jenkins might not run with the same user (or on the same workstation, if the agent executing the job is a separate machine)

Double-check if there are any environment variable differences between:

For instance, a LD_LIBRARY_PATH difference could explain the discrepancy between the two builds.

Vantage answered 27/12, 2018 at 11:31 Comment(2)
Are there any other environment variables I should pay attention to, besides LD_LIBRARY_PATH?Hayashi
@VladimirLindemann look for any difference between the list of environment variables in your bash session as opposed to the one in a Jenkins job.Vantage
U
3

Make sure you have all the header files included and libraries linked at the time of compilation. Undefined Reference errors primarily arise due to these two reasons.

Unstrap answered 3/1, 2019 at 4:53 Comment(0)
B
2

user jenkins has it's own ~/.bashrc, which might lack environmental variables.

temporarily enable login shell for jenkins, setup the environment, then disable it again.

when being able to manually build as user jenkins, it should also build when automated.

Bligh answered 27/12, 2018 at 11:31 Comment(2)
Actually, I tried building using that user. But my build system uses a complicated script for Jenkins. That script sets up all the environment variables. I should compare these thoroughly, I think.Hayashi
@VladimirLindemann just run printenv with the regular user and with user jenkins. comparing the actual result of the scripts is easier than comparing the scripts. there has to be some difference - possibly different permissions. adding the regular user into group jenkins might also help, if this is the case - because it grants user jenkins group access, where it otherwise wouldn't have access.Bligh
H
1

The problem is solved. We copied the Jenkins/AOSP setup from another server, and something was wrong with the copy. The cleanup of the ccache solved the problem. After performing "ccache -c" command, everything worked fine.

Hayashi answered 18/1, 2019 at 12:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.