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

Bump to llvm/master/bdb3a116 #1211

Merged
merged 1 commit into from
Jan 23, 2018

Conversation

jonpryor
Copy link
Member

Fixes: #1182

@jonpryor jonpryor added the full-mono-integration-build For PRs; run a full build (~6-10h for mono bumps), not the faster PR subset (~2h for mono bumps) label Jan 19, 2018
@jonpryor
Copy link
Member Author

The macOS+xbuild PR Build is failing because something is seriously b0rked: we're only partially building the Debug configuration.

For example, the log file contains:

  adding: xamarin.android-oss_v8.2.99.36_Darwin-x86_64_HEAD_08dcbc2/bin/Debug/lib/xamarin.android/xbuild/Xamarin/Android/lib/host-mxe-Win64/libMonoPosixHelper.d.dll (deflated 75%)
  adding: xamarin.android-oss_v8.2.99.36_Darwin-x86_64_HEAD_08dcbc2/bin/Debug/lib/xamarin.android/xbuild/Xamarin/Android/lib/host-mxe-Win64/libMonoPosixHelper.dll (deflated 75%)
  adding: xamarin.android-oss_v8.2.99.36_Darwin-x86_64_HEAD_08dcbc2/bin/Debug/lib/xamarin.android/xbuild/Xamarin/Android/lib/host-mxe-Win64/libmonosgen-2.0.d.dll (deflated 75%)
  adding: xamarin.android-oss_v8.2.99.36_Darwin-x86_64_HEAD_08dcbc2/bin/Debug/lib/xamarin.android/xbuild/Xamarin/Android/lib/host-mxe-Win64/libmonosgen-2.0.dll (deflated 69%)

Compare to Release binaries:

  adding: xamarin.android-oss_v8.2.99.36_Darwin-x86_64_HEAD_08dcbc2/bin/Release/lib/xamarin.android/xbuild/Xamarin/Android/lib/host-mxe-Win64/libmono-android.debug.d.dll (deflated 73%)
  adding: xamarin.android-oss_v8.2.99.36_Darwin-x86_64_HEAD_08dcbc2/bin/Release/lib/xamarin.android/xbuild/Xamarin/Android/lib/host-mxe-Win64/libmono-android.debug.dll (deflated 68%)
  adding: xamarin.android-oss_v8.2.99.36_Darwin-x86_64_HEAD_08dcbc2/bin/Release/lib/xamarin.android/xbuild/Xamarin/Android/lib/host-mxe-Win64/libmono-android.release.d.dll (deflated 68%)
  adding: xamarin.android-oss_v8.2.99.36_Darwin-x86_64_HEAD_08dcbc2/bin/Release/lib/xamarin.android/xbuild/Xamarin/Android/lib/host-mxe-Win64/libmono-android.release.dll (deflated 67%)
  adding: xamarin.android-oss_v8.2.99.36_Darwin-x86_64_HEAD_08dcbc2/bin/Release/lib/xamarin.android/xbuild/Xamarin/Android/lib/host-mxe-Win64/libMonoPosixHelper.d.dll (deflated 69%)
  adding: xamarin.android-oss_v8.2.99.36_Darwin-x86_64_HEAD_08dcbc2/bin/Release/lib/xamarin.android/xbuild/Xamarin/Android/lib/host-mxe-Win64/libMonoPosixHelper.dll (deflated 57%)
  adding: xamarin.android-oss_v8.2.99.36_Darwin-x86_64_HEAD_08dcbc2/bin/Release/lib/xamarin.android/xbuild/Xamarin/Android/lib/host-mxe-Win64/libmonosgen-2.0.d.dll (deflated 65%)
  adding: xamarin.android-oss_v8.2.99.36_Darwin-x86_64_HEAD_08dcbc2/bin/Release/lib/xamarin.android/xbuild/Xamarin/Android/lib/host-mxe-Win64/libmonosgen-2.0.dll (deflated 58%)

Similarly weird, we're building Xamarin.Android.NUnitLite.dll in Release, but not Debug:

  adding: xamarin.android-oss_v8.2.99.36_Darwin-x86_64_HEAD_08dcbc2/bin/Release/lib/xamarin.android/xbuild-frameworks/MonoAndroid/v1.0/Xamarin.Android.NUnitLite.dll (deflated 57%)
  adding: xamarin.android-oss_v8.2.99.36_Darwin-x86_64_HEAD_08dcbc2/bin/Release/lib/xamarin.android/xbuild-frameworks/MonoAndroid/v1.0/Xamarin.Android.NUnitLite.pdb (deflated 54%)
  adding: xamarin.android-oss_v8.2.99.36_Darwin-x86_64_HEAD_08dcbc2/bin/Release/lib/xamarin.android/xbuild-frameworks/MonoAndroid/v1.0/Xamarin.Android.NUnitLite.xml (deflated 90%)

We're not adding the Debug versions, because they don't exist.

The question is, why?!

@jonpryor
Copy link
Member Author

The question is, why?!

From the log file (newlines added for readability):

rm -f bin/Debug/lib/xamarin.android/xbuild-frameworks/MonoAndroid/v1.0/Xamarin.Android.NUnitLite.dll;
MSBUILD="xbuild" tools/scripts/xabuild /p:Configuration=Debug /p:AutoProvision=True \
	/p:AutoProvisionUsesSudo=True /p:IgnoreMaxMonoVersion=False \
	/v:diag /p:_DebugFileExt=.pdb \
	src/Xamarin.Android.NUnitLite/Xamarin.Android.NUnitLite.csproj \
	/p:Configuration=Debug \
	/p:AndroidSupportedTargetJitAbis=armeabi:armeabi-v7a:arm64-v8a:x86:x86_64 \
	/p:AndroidSupportedHostJitAbis=Darwin:mxe-Win32:mxe-Win64 \
	/p:AndroidSupportedTargetAotAbis=armeabi:arm64:x86:x86_64:win-armeabi:win-arm64:win-x86:win-x86_64 \
	/p:AndroidApiLevel=10 /p:AndroidPlatformId=10 /p:AndroidFrameworkVersion=v2.3;
rm -f bin/Release/lib/xamarin.android/xbuild-frameworks/MonoAndroid/v1.0/Xamarin.Android.NUnitLite.dll;
MSBUILD="xbuild" tools/scripts/xabuild /p:Configuration=Debug /p:AutoProvision=True \
	/p:AutoProvisionUsesSudo=True /p:IgnoreMaxMonoVersion=False \
	/v:diag /p:_DebugFileExt=.pdb \
	src/Xamarin.Android.NUnitLite/Xamarin.Android.NUnitLite.csproj \
	/p:Configuration=Release \
	/p:AndroidSupportedTargetJitAbis=armeabi:armeabi-v7a:arm64-v8a:x86:x86_64 \
	/p:AndroidSupportedHostJitAbis=Darwin:mxe-Win32:mxe-Win64 \
	/p:AndroidSupportedTargetAotAbis=armeabi:arm64:x86:x86_64:win-armeabi:win-arm64:win-x86:win-x86_64 \
	/p:AndroidApiLevel=10 /p:AndroidPlatformId=10 /p:AndroidFrameworkVersion=v2.3;

This is where we build Xamarin.Android.NUnitLite.dll for Debug configuration. Then:

src/Xamarin.Android.NUnitLite/Xamarin.Android.NUnitLite.csproj: error : /Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/src/Xamarin.Android.NUnitLite/Xamarin.Android.NUnitLite.csproj: /Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/src/Xamarin.Android.NUnitLite/Xamarin.Android.NUnitLite.csproj could not import "$(OutputPath)\..\..\..\xbuild\Xamarin\Android\Xamarin.Android.CSharp.targets"
src/Xamarin.Android.NUnitLite/Xamarin.Android.NUnitLite.csproj: Microsoft.Build.BuildEngine.InvalidProjectFileException: /Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/src/Xamarin.Android.NUnitLite/Xamarin.Android.NUnitLite.csproj: /Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/src/Xamarin.Android.NUnitLite/Xamarin.Android.NUnitLite.csproj could not import "$(OutputPath)\..\..\..\xbuild\Xamarin\Android\Xamarin.Android.CSharp.targets" ---> Microsoft.Build.BuildEngine.InvalidProjectFileException: /Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/src/Xamarin.Android.NUnitLite/Xamarin.Android.NUnitLite.csproj could not import "$(OutputPath)\..\..\..\xbuild\Xamarin\Android\Xamarin.Android.CSharp.targets"
  at Microsoft.Build.BuildEngine.Import.ForEachExtensionPathTillFound (System.Xml.XmlElement xmlElement, Microsoft.Build.BuildEngine.Project project, Microsoft.Build.BuildEngine.ImportedProject importingProject, System.Func`3[T1,T2,TResult] func) [0x0027d] in /Users/builder/data/lanes/5533/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Import.cs:229 
  at Microsoft.Build.BuildEngine.Project.AddImport (System.Xml.XmlElement xmlElement, Microsoft.Build.BuildEngine.ImportedProject importingProject, System.Boolean evaluate_properties) [0x0006e] in /Users/builder/data/lanes/5533/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs:1135 
  at Microsoft.Build.BuildEngine.Project.ProcessElements (System.Xml.XmlElement rootElement, Microsoft.Build.BuildEngine.ImportedProject ip) [0x00213] in /Users/builder/data/lanes/5533/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs:933 
  at Microsoft.Build.BuildEngine.Project.ProcessXml () [0x000aa] in /Users/builder/data/lanes/5533/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs:884 
  at Microsoft.Build.BuildEngine.Project.DoLoad (System.IO.TextReader textReader) [0x000fe] in /Users/builder/data/lanes/5533/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs:851 
   --- End of inner exception stack trace ---
  at Microsoft.Build.BuildEngine.Project.DoLoad (System.IO.TextReader textReader) [0x00113] in /Users/builder/data/lanes/5533/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs:854 
  at Microsoft.Build.BuildEngine.Project.Load (System.String projectFileName, Microsoft.Build.BuildEngine.ProjectLoadSettings projectLoadSettings) [0x00117] in /Users/builder/data/lanes/5533/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs:540 
  at Microsoft.Build.BuildEngine.Project.Load (System.String projectFileName) [0x00000] in /Users/builder/data/lanes/5533/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs:506 
  at Microsoft.Build.BuildEngine.Engine.BuildProjectFileInternal (System.String projectFile, System.String[] targetNames, Microsoft.Build.BuildEngine.BuildPropertyGroup globalProperties, System.Collections.IDictionary targetOutputs, Microsoft.Build.BuildEngine.BuildSettings buildFlags, System.String toolsVersion) [0x0009f] in /Users/builder/data/lanes/5533/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Engine.cs:288 
  at Microsoft.Build.BuildEngine.Engine.BuildProjectFile (System.String projectFile, System.String[] targetNames, Microsoft.Build.BuildEngine.BuildPropertyGroup globalProperties, System.Collections.IDictionary targetOutputs, Microsoft.Build.BuildEngine.BuildSettings buildFlags, System.String toolsVersion) [0x00008] in /Users/builder/data/lanes/5533/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Engine.cs:237 
Target performance summary:

Tasks performance summary:

Build FAILED.
Errors:

src/Xamarin.Android.NUnitLite/Xamarin.Android.NUnitLite.csproj: error : /Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/src/Xamarin.Android.NUnitLite/Xamarin.Android.NUnitLite.csproj: /Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/src/Xamarin.Android.NUnitLite/Xamarin.Android.NUnitLite.csproj could not import "$(OutputPath)\..\..\..\xbuild\Xamarin\Android\Xamarin.Android.CSharp.targets"

         0 Warning(s)
         1 Error(s)

Oops.

So now we have a better greping point: [0-9]+ Error. First match with a non-0 value:

                                                MONO_PATH="./../../class/lib/build:$MONO_PATH" CSC_SDK_PATH_DISABLED= /Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/build-tools/mono-runtimes/obj/Debug/host-Darwin/runtime/mono-
wrapper  --aot-path=/Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/external/mono/mcs/class/lib/build --gc-params=nursery-size=64m /Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/external/mono/extern
al/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.2.3.2/tools/csc.exe /codepage:65001 /nologo /noconfig /deterministic -unsafe -nostdlib -nowarn:612,618,1635 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC -d:FEATURE_PAL,GENERICS_WORK,FEATURE_
LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTI
ON_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT,HAS_CORLIB_CONTRACTS -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP
,FEATURE_ROLE_BASED_SECURITY -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS  -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MON
ODROID -d:ANDROID -nowarn:1699 -nostdlib  /debug:portable -optimize  -r:./../../class/lib/monodroid/nunitlite.dll -warn:0 \
                                                                -r:Test/System.Runtime.Serialization.Formatters.Binary/VersionTolerantSerialization/monodroid_TestLib/1.0/Address.dll \
                                                                -r:./../../class/lib/monodroid/mscorlib.dll \
                                                                -r:./../../class/lib/monodroid/System.dll \
                                                                Test/System.Runtime.Serialization.Formatters.Binary/VersionTolerantSerialization/BinarySerializationOverVersions.cs -out:Test/System.Runtime.Serialization.Formatters.Binary/VersionTolerantSerialization/monodroid_TestLib/BinarySerializationOverVersions.exe
                                                /Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/external/mono/external/nunit-lite/NUnitLite-1.0.0/src/framework/Runner/ResultReporter.cs(119,13): warning CS0162: Unreachable code detected
                                                MONO_PATH="./../../../class/lib/build:$MONO_PATH" /Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/build-tools/mono-runtimes/obj/Debug/host-Darwin/runtime/mono-wrapper  ./../../../class/lib/build/sn.exe -q -R ../../../class/lib/monodroid/nunitlite.dll ../../../../external/nunit-lite/NUnitLite-1.0.0/src/framework/nunit.snk
                                                error CS0009: Metadata file '/Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/external/mono/mcs/class/lib/monodroid/nunitlite.dll' could not be opened -- PE image doesn't contain managed metadata.
                                                Test/System.Runtime.Serialization.Formatters.Binary/VersionTolerantSerialization/BinarySerializationOverVersions.cs(9,7): error CS0246: The type or namespace name 'NUnit' could not be found (are you missing a using directive or an assembly reference?)
...
                                                make[6]: *** [Test/System.Runtime.Serialization.Formatters.Binary/VersionTolerantSerialization/monodroid_TestLib/BinarySerializationOverVersions.exe] Error 1
                                                make[6]: *** Waiting for unfinished jobs....
                                                make[5]: *** [test-recursive] Error 1
                                                make[4]: *** [test-recursive] Error 1
                                                make[3]: *** [profile-do--monodroid--test] Error 2
                                                make[2]: *** [profiles-do--test] Error 2
                                                make[1]: *** [mcs-do-test-profiles] Error 2

        /Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/build-tools/mono-runtimes/mono-runtimes.targets: error : Command 'make -j4 test # armeabi' exited with code: 2.

         44 Warning(s)
         1 Error(s)

On the one hand, we dearly need better error handling in our build process. We basically have errors being ignored, resulting in more obscure build errors later on. :-/

On the other hand...WTF is going on in the mono build that nunitlite.dll isn't being built?!

Searching backwards...it gets weirder. The build for nunitlite.dll doesn't flag an error:

MONO_PATH="./../../../class/lib/build:$MONO_PATH" CSC_SDK_PATH_DISABLED= /Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/build-tools/mono-runtimes/obj/Debug/host-Darwin/runtime/mo
no-wrapper  --aot-path=/Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/external/mono/mcs/class/lib/build --gc-params=nursery-size=64m /Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/external/mono/ext
ernal/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.2.3.2/tools/csc.exe /codepage:65001 /nologo /noconfig /deterministic /target:library /define:"__MOBILE__;TRACE;DEBUG;NET_4_0;CLR_4_0,NUNITLITE" /warn:4 /keyfile:../../../../external/nun
it-lite/NUnitLite-1.0.0/src/framework/nunit.snk /publicsign  -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -nowarn:1699 -nostdlib -r:./../../../class/lib/monodro
id/mscorlib.dll /debug:portable -optimize   -r:./../../../class/lib/monodroid/System.dll -r:./../../../class/lib/monodroid/System.Xml.dll -r:./../../../class/lib/monodroid/System.Core.dll    -target:library -out:../../../class/lib/monodroid/nunitlite.dll 
 @./../../../build/deps/_monodroid__nunitlite.dll.response
                                                /Applications/Xcode8.1-beta1.app/Contents/Developer/usr/bin/make test-local
                                                cd ./../../tools/nunit-lite && /Applications/Xcode8.1-beta1.app/Contents/Developer/usr/bin/make
                                                /Applications/Xcode8.1-beta1.app/Contents/Developer/usr/bin/make all-local
                                                /Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/external/mono/external/nunit-lite/NUnitLite-1.0.0/src/framework/Runner/ResultReporter.cs(119,13): warning CS0162: Unreachable code detected

We sign it without error:

NO_PATH="./../../../class/lib/build:$MONO_PATH" /Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/build-tools/mono-runtimes/obj/Debug/host-Darwin/runtime/mono-wrapper  ./../../../class/lib/build/sn.exe -q -R ../../../class/lib/monodroid/nunitlite.dll ../../../../external/nunit-lite/NUnitLite-1.0.0/src/framework/nunit.sn

We build nunit-lite-console.exe which references it, without error:

MONO_PATH="./../../../class/lib/build:$MONO_PATH" CSC_SDK_PATH_DISABLED= /Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/build-tools/mono-runtimes/obj/Debug/host-Darwin/runtime/mono-wrapper  --aot-path=/Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/external/mono/mcs/class/lib/build --gc-params=nursery-size=64m /Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/external/mono/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.2.3.2/tools/csc.exe /codepage:65001 /nologo /noconfig /deterministic   -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll /debug:portable -optimize  -r:./../../../class/lib/monodroid/nunitlite.dll -target:exe -out:../../../class/lib/monodroid/nunit-lite-console.exe   @nunit-lite-console.exe.sources

But the BinarySerializationOverVersions.exe build fails.

Somehow, between the build of nunit-lite-console.exe and the build of BinarySerializationOverVersions.exe, mcs/class/lib/monodroid/nunitlite.dll is corrupted.

WTF?

@jonpryor
Copy link
Member Author

A rebuild, with no PR changes, resulted in a successful build.

@jonpryor
Copy link
Member Author

@pjcollins: Do you want to test the built Xamarin.Android.Sdk-OSS-8.2.99.37_HEAD_ed79ebd.vsix before we merge this PR?

@pjcollins
Copy link
Member

@jonpryor yes sounds good, I will take a look today.

@pjcollins
Copy link
Member

@jonpryor the OSS vsix you've linked above works for my failing case, I am happy to merge this.

@jonpryor jonpryor merged commit 8aeb084 into dotnet:master Jan 23, 2018
jonpryor added a commit to jonpryor/xamarin-android that referenced this pull request Jan 23, 2018
Context: dotnet#1211 (comment)
Context: dotnet#1211 (comment)

What *should* happen when a portion of a build fails?
That's not entirely rhetorical: the *entire* build should fail.

What *does* happen when a portion of a build fails?
Unfortunately that's also not rhetorical: the build continues!

(Say what?!)

Case in point: [PR dotnet#1211 build 2373][pr-2373], which experienced a
failure in the mono build:

[pr-2373]: https://jenkins.mono-project.com/view/Xamarin.Android/job/xamarin-android-pr-builder/2373/

        MONO_PATH="./../../class/lib/build:$MONO_PATH" ... -R ../../../class/lib/monodroid/nunitlite.dll ...
        error CS0009: Metadata file '/Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/external/mono/mcs/class/lib/monodroid/nunitlite.dll' could not be opened -- PE image doesn't contain managed metadata.

*But the error was ignored*, and the build continued, resulting in the
"final" errors (among others)

        System.Net/NetworkChangeTest.cs(5,7): error CS0246: The type or namespace name `NUnit' could not be found. Are you missing an assembly reference?

**This is *madness*.** The first error *should* have stopped the
build. The build *wasn't* stopped, meaning that it continued -- with
an "unstable" tree state -- resulting in "bizarre" build errors
*later*. In particular, `Xamarin.Android.NUniteLite.dll` wasn't built
in the *Debug* configuration because the *mono* build failed for the
Debug configuration, but everything "worked" in Release.

The fundamental cause of this madness? Makefile rules such as
`make leeroy-all`, which *effectively* are:

        tools/scripts/xabuild Xamarin.Android.sln /p:Configuration=Debug ; \
        tools/scripts/xabuild Xamarin.Android.sln /p:Configuration=Release; \

*Because* of the `;` separating the commands, any errors from the
first command are *ignored*, resulting in the tearing out of my hair
when everything goes "weird".

Review the Makefile targets in `Makefile` and
`build-tools/scripts/BuildEverything.mk` and replace `;` with
`|| exit 1` when the command should have fatal errors. This *should*
cause the build to fail the *first* time an error is encountered,
instead of continuing on its merry way to die horribly later.
jonpryor added a commit that referenced this pull request Jan 24, 2018
Context: #1211 (comment)
Context: #1211 (comment)

What *should* happen when a portion of a build fails?
That's not entirely rhetorical: the *entire* build should fail.

What *does* happen when a portion of a build fails?
Unfortunately that's also not rhetorical: the build continues!

(Say what?!)

Case in point: [PR #1211 build 2373][pr-2373], which experienced a
failure in the mono build:

[pr-2373]: https://jenkins.mono-project.com/view/Xamarin.Android/job/xamarin-android-pr-builder/2373/

        MONO_PATH="./../../class/lib/build:$MONO_PATH" ... -R ../../../class/lib/monodroid/nunitlite.dll ...
        error CS0009: Metadata file '/Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/external/mono/mcs/class/lib/monodroid/nunitlite.dll' could not be opened -- PE image doesn't contain managed metadata.

*But the error was ignored*, and the build continued, resulting in the
"final" errors (among others)

        System.Net/NetworkChangeTest.cs(5,7): error CS0246: The type or namespace name `NUnit' could not be found. Are you missing an assembly reference?

**This is *madness*.** The first error *should* have stopped the
build. The build *wasn't* stopped, meaning that it continued -- with
an "unstable" tree state -- resulting in "bizarre" build errors
*later*. In particular, `Xamarin.Android.NUniteLite.dll` wasn't built
in the *Debug* configuration because the *mono* build failed for the
Debug configuration, but everything "worked" in Release.

The fundamental cause of this madness? Makefile rules such as
`make leeroy-all`, which *effectively* are:

        tools/scripts/xabuild Xamarin.Android.sln /p:Configuration=Debug ; \
        tools/scripts/xabuild Xamarin.Android.sln /p:Configuration=Release; \

*Because* of the `;` separating the commands, any errors from the
first command are *ignored*, resulting in the tearing out of my hair
when everything goes "weird".

Review the Makefile targets in `Makefile` and
`build-tools/scripts/BuildEverything.mk` and replace `;` with
`|| exit 1` when the command should have fatal errors. This *should*
cause the build to fail the *first* time an error is encountered,
instead of continuing on its merry way to die horribly later.
@github-actions github-actions bot locked and limited conversation to collaborators Feb 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
full-mono-integration-build For PRs; run a full build (~6-10h for mono bumps), not the faster PR subset (~2h for mono bumps)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants