From 3118e83a6de56abde6ab0ad4758450e3a309f05b Mon Sep 17 00:00:00 2001 From: Jonathan Pryor Date: Sat, 13 Aug 2016 22:06:55 -0400 Subject: [PATCH] [mono-runtimes] "Install" eglib headers into $prefix/include Context: https://github.com/xamarin/xamarin-android/pull/162 PR #162 tries to use the mono bundle (fbfd676c) to avoid rebuilding mono on subsequent builds (when the mono commit hasn't changed), in order to speed up the Jenkins build process (currently tracking at ~3.5 *hours* for a non-PR build...) [PR #162 currently fails][0] when building `src/monodroid`: Executing: /Users/builder/android-toolchain/ndk/ndk-build CONFIGURATION=Debug NDK_LIBS_OUT=./libs/Debug NDK_OUT=./obj/Debug V=1 ... [armeabi-v7a] Compile thumb : monodroid <= nl.c /Users/builder/android-toolchain/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-gcc -MMD -MP -MF ./obj/Debug/local/armeabi-v7a/objs/monodroid/__/__/__/external/mono/support/nl.o.d -fpic -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -mthumb -Os -g -DNDEBUG -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -Ijni/../../../build-tools/mono-runtimes/obj/Debug/armeabi-v7a -Ijni/../../../build-tools/mono-runtimes/obj/Debug/armeabi-v7a/eglib -Ijni/../../../build-tools/mono-runtimes/obj/Debug/armeabi-v7a/eglib/src -Ijni/../../../external/mono/eglib/src -Ijni/zip -Ijni -DANDROID -ggdb3 -O0 -fno-omit-frame-pointer -std=c99 -DHAVE_LINUX_NETLINK_H=1 -DHAVE_LINUX_RTNETLINK_H=1 -D_REENTRANT -DPLATFORM_ANDROID -DANDROID -DLINUX -Dlinux -D__linux_ -DHAVE_CONFIG_H -DJI_DLL_EXPORT -DMONO_DLL_EXPORT -I/libmonodroid/zip -I/include -I/include/eglib -mandroid -fno-strict-aliasing -ffunction-sections -fomit-frame-pointer -funswitch-loops -finline-limit=300 -fvisibility=hidden -fstack-protector -Wa,--noexecstack -Wformat -Werror=format-security -DDEBUG=1 -Wa,--noexecstack -Wformat -Werror=format-security -isystem /Users/builder/android-toolchain/ndk/platforms/android-9/arch-arm/usr/include -c jni/../../../external/mono/support/nl.c -o ./obj/Debug/local/armeabi-v7a/objs/monodroid/__/__/__/external/mono/support/nl.o In file included from jni/../../../external/mono/support/nl.h:3:0, from jni/../../../external/mono/support/nl.c:14: jni/../../../external/mono/eglib/src/glib.h:18:26: fatal error: eglib-config.h: No such file or directory #include ^ compilation terminated. `src/monodroid` fails to build because it requires build artifacts located in `build-tools/mono-runtimes/obj/$(Configuration)/%(Identity)/eglib`, which doesn't exist when the mono bundle is being used (because we never built mono!) Fix this issue by updating the `_InstallRuntimes` target in `mono-runtimes.targets` to copy the generated eglib header files into `bin/$(Configuration)/include/%(Identity)/eglib`, and update `bundle.targets` so that the `include` directory is also included in the mono bundle. This should allow a future PR #162 fix to build, as all required generated files will be present within the bundle. Additionally, add the `$(HostOS)` and a version number to the bundle filename, now `-v1`, to note that the structure of the bundle has changed, *without* a corresponding mono, llvm, or libzip commit bump. [0]: https://jenkins.mono-project.com/view/Xamarin.Android/job/xamarin-android-pr-builder/61/ --- build-tools/bundle/bundle.mdproj | 2 +- build-tools/bundle/bundle.targets | 3 ++- build-tools/mono-runtimes/mono-runtimes.targets | 16 ++++++++++++++++ external/mono | 2 +- src/monodroid/jni/Android.mk | 4 +--- 5 files changed, 21 insertions(+), 6 deletions(-) diff --git a/build-tools/bundle/bundle.mdproj b/build-tools/bundle/bundle.mdproj index 8e9541bcd98..eea19bb4499 100644 --- a/build-tools/bundle/bundle.mdproj +++ b/build-tools/bundle/bundle.mdproj @@ -7,7 +7,7 @@ {1640725C-4DB8-4D8D-BC96-74E688A06EEF} - 1 + ..\..\bin\Debug diff --git a/build-tools/bundle/bundle.targets b/build-tools/bundle/bundle.targets index 5c2c6a3c93d..3401b494e74 100644 --- a/build-tools/bundle/bundle.targets +++ b/build-tools/bundle/bundle.targets @@ -33,7 +33,7 @@ - <_BundlePath>$(OutputPath)bundle-$(Configuration)-libzip=$(_LibZipHash),llvm=$(_LlvmHash),mono=$(_MonoHash).zip + <_BundlePath>$(OutputPath)bundle-v1-$(Configuration)-$(HostOS)-libzip=$(_LibZipHash),llvm=$(_LlvmHash),mono=$(_MonoHash).zip <_Archive Include="@(_InstallMonoPosixHelperOutput)" /> <_Archive Include="@(_InstallUnstrippedMonoPosixHelperOutput)" /> + <_Archive Include="@(_RuntimeEglibHeaderOutput)" /> <_Archive Include="@(_LibZipTarget->'$(OutputPath)lib\xbuild\Xamarin\Android\%(OutputLibrary)')" /> <_Archive Include="$(OutputPath)%(_MonoCrossRuntime.InstallPath)%(_MonoCrossRuntime.CrossMonoName)%(_MonoCrossRuntime.ExeSuffix)" Condition=" '@(_MonoCrossRuntime)' != '' " diff --git a/build-tools/mono-runtimes/mono-runtimes.targets b/build-tools/mono-runtimes/mono-runtimes.targets index d1c82b5e981..3af296c70d9 100644 --- a/build-tools/mono-runtimes/mono-runtimes.targets +++ b/build-tools/mono-runtimes/mono-runtimes.targets @@ -198,6 +198,14 @@ Condition=" '%(_MonoRuntime.DoBuild)' == 'True' And '%(_MonoRuntime.OutputMonoPosixHelperFilename)' != '' " Include="@(_MonoRuntime->'$(OutputPath)\lib\xbuild\Xamarin\Android\lib\%(Identity)\%(OutputMonoPosixHelperFilename).d.%(NativeLibraryExtension)')" /> + <_RuntimeEglibHeaderSource + Condition=" '%(_MonoRuntime.DoBuild)' == 'True' " + Include="@(_MonoRuntime->'$(IntermediateOutputPath)%(Identity)\eglib\config.h');@(_MonoRuntime->'$(IntermediateOutputPath)%(Identity)\eglib\src\eglib-config.h')" + /> + <_RuntimeEglibHeaderOutput + Condition=" '%(_MonoRuntime.DoBuild)' == 'True' " + Include="@(_MonoRuntime->'$(OutputPath)include\%(Identity)\eglib\config.h');@(_MonoRuntime->'$(OutputPath)include\%(Identity)\eglib\eglib-config.h')" + /> <_RuntimeBuildStamp Condition=" '%(_MonoRuntime.DoBuild)' == 'true' " Include="@(_MonoRuntime->'$(IntermediateOutputPath)%(Identity)\.stamp')" /> @@ -222,6 +230,14 @@ Condition=" '%(_MonoRuntime.DoBuild)' == 'true' " Directories="$(OutputPath)\lib\xbuild\Xamarin\Android\lib\%(_MonoRuntime.Identity)" /> + +