From 39fd46c11f9766964cf051310d01728dbb06aad8 Mon Sep 17 00:00:00 2001 From: Jonathan Pryor Date: Sun, 14 Aug 2016 16:38:54 -0400 Subject: [PATCH] [mono-runtimes] Bundle Consts.cs, use correct opt.exe install location 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/Mono.Data.Sqlite`: CSC: error CS2001: Source file `/Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/external/mono/mcs/build/common/Consts.cs' could not be found Fix this error by copying `external/mono/mcs/build/common/Consts.cs` into `bin/$(Configuration)/include`, and updating the `Consts.cs` references within `Mono.Data.Sqlite.csproj` and `Mono.Posix.csproj` so that they'll use the `include` copy. This should allow us to use the bundle to build these projects. Additionally, `llc.exe` and `opt.exe` are installed into `$prefix/bin`, which isn't correct; `$prefix/bin` as a construct doesn't exist on Windows. Install these into `$prefix/lib/mandroid`. Update the bundle version to note these bundle changes. [0]: https://jenkins.mono-project.com/view/Xamarin.Android/job/xamarin-android-pr-builder/67/console --- build-tools/bundle/bundle.targets | 3 ++- .../mono-runtimes/mono-runtimes.projitems | 4 ++++ build-tools/mono-runtimes/mono-runtimes.targets | 16 ++++++++++++++-- src/Mono.Data.Sqlite/Mono.Data.Sqlite.csproj | 2 +- src/Mono.Posix/Mono.Posix.csproj | 2 +- 5 files changed, 22 insertions(+), 5 deletions(-) diff --git a/build-tools/bundle/bundle.targets b/build-tools/bundle/bundle.targets index 3401b494e74..66cd997ebe5 100644 --- a/build-tools/bundle/bundle.targets +++ b/build-tools/bundle/bundle.targets @@ -33,7 +33,7 @@ - <_BundlePath>$(OutputPath)bundle-v1-$(Configuration)-$(HostOS)-libzip=$(_LibZipHash),llvm=$(_LlvmHash),mono=$(_MonoHash).zip + <_BundlePath>$(OutputPath)bundle-v2-$(Configuration)-$(HostOS)-libzip=$(_LibZipHash),llvm=$(_LlvmHash),mono=$(_MonoHash).zip <_Archive Include="@(_RuntimeEglibHeaderOutput)" /> <_Archive Include="@(_LibZipTarget->'$(OutputPath)lib\xbuild\Xamarin\Android\%(OutputLibrary)')" /> + <_Archive Include="@(_MonoConstsOutput)" /> <_Archive Include="$(OutputPath)%(_MonoCrossRuntime.InstallPath)%(_MonoCrossRuntime.CrossMonoName)%(_MonoCrossRuntime.ExeSuffix)" Condition=" '@(_MonoCrossRuntime)' != '' " /> diff --git a/build-tools/mono-runtimes/mono-runtimes.projitems b/build-tools/mono-runtimes/mono-runtimes.projitems index 45a462cf7bd..c760644ff47 100644 --- a/build-tools/mono-runtimes/mono-runtimes.projitems +++ b/build-tools/mono-runtimes/mono-runtimes.projitems @@ -228,6 +228,7 @@ true + bin/ <_LlvmRuntime Include="llvm64" Condition=" '$(_LlvmNeeded)' != '' And '$(_LlvmCanBuild64)' == 'yes' "> @@ -238,6 +239,7 @@ true + bin/ <_LlvmRuntime Include="llvmwin32" Condition=" '$(_LlvmNeeded)' != '' And $(AndroidSupportedHostJitAbisForConditionalChecks.Contains (':mxe-Win32:')) "> @@ -248,6 +250,7 @@ PATH="$(AndroidMxeFullPath)\bin:$(PATH)" .exe true + lib/mandroid/ <_LlvmRuntime Include="llvmwin64" Condition=" '$(_LlvmNeeded)' != '' And $(AndroidSupportedHostJitAbisForConditionalChecks.Contains (':mxe-Win64:')) "> @@ -258,6 +261,7 @@ PATH="$(AndroidMxeFullPath)\bin:$(PATH)" .exe false + lib/mandroid/ diff --git a/build-tools/mono-runtimes/mono-runtimes.targets b/build-tools/mono-runtimes/mono-runtimes.targets index 3af296c70d9..d2ac1af851d 100644 --- a/build-tools/mono-runtimes/mono-runtimes.targets +++ b/build-tools/mono-runtimes/mono-runtimes.targets @@ -85,10 +85,10 @@ <_LlvmArchive Include="$(_LlvmOutputDirTop)\%(_LlvmRuntime.BuildDir)\Release\lib\*.a" /> <_LlvmSourceBinary Include="@(_LlvmRuntime->'$(_LlvmOutputDirTop)\%(BuildDir)\Release\bin\opt%(ExeSuffix)')" Condition=" '%(_LlvmRuntime.InstallBinaries)' == 'true' " /> - <_LlvmTargetBinary Include="@(_LlvmRuntime->'$(OutputPath)\bin\opt%(ExeSuffix)')" Condition=" '%(_LlvmRuntime.InstallBinaries)' == 'true' "/> + <_LlvmTargetBinary Include="@(_LlvmRuntime->'$(OutputPath)\%(InstallPath)opt%(ExeSuffix)')" Condition=" '%(_LlvmRuntime.InstallBinaries)' == 'true' "/> <_LlvmSourceBinary Include="@(_LlvmRuntime->'$(_LlvmOutputDirTop)\%(BuildDir)\Release\bin\llc%(ExeSuffix)')" Condition=" '%(_LlvmRuntime.InstallBinaries)' == 'true' " /> - <_LlvmTargetBinary Include="@(_LlvmRuntime->'$(OutputPath)\bin\llc%(ExeSuffix)')" Condition=" '%(_LlvmRuntime.InstallBinaries)' == 'true' " /> + <_LlvmTargetBinary Include="@(_LlvmRuntime->'$(OutputPath)\%(InstallPath)llc%(ExeSuffix)')" Condition=" '%(_LlvmRuntime.InstallBinaries)' == 'true' " /> @@ -206,6 +206,14 @@ Condition=" '%(_MonoRuntime.DoBuild)' == 'True' " Include="@(_MonoRuntime->'$(OutputPath)include\%(Identity)\eglib\config.h');@(_MonoRuntime->'$(OutputPath)include\%(Identity)\eglib\eglib-config.h')" /> + <_MonoConstsSource + Condition=" '%(_MonoRuntime.DoBuild)' == 'True' " + Include="$(MonoSourceFullPath)\mcs\build\common\Consts.cs" + /> + <_MonoConstsOutput + Condition=" '%(_MonoRuntime.DoBuild)' == 'True' " + Include="$(OutputPath)include\Consts.cs" + /> <_RuntimeBuildStamp Condition=" '%(_MonoRuntime.DoBuild)' == 'true' " Include="@(_MonoRuntime->'$(IntermediateOutputPath)%(Identity)\.stamp')" /> @@ -238,6 +246,10 @@ SourceFiles="@(_RuntimeEglibHeaderSource)" DestinationFiles="@(_RuntimeEglibHeaderOutput)" /> + Locale.cs - + Consts.cs diff --git a/src/Mono.Posix/Mono.Posix.csproj b/src/Mono.Posix/Mono.Posix.csproj index 81cadc91d4a..37e6ce4fc9c 100644 --- a/src/Mono.Posix/Mono.Posix.csproj +++ b/src/Mono.Posix/Mono.Posix.csproj @@ -226,7 +226,7 @@ Locale.cs - + Consts.cs