Commit 79e3b97
authored
[JdkInfo] handle invalid XML from /usr/libexec/java_home (#120)
Context: dotnet/android#5992
Context: https://dev.azure.com/xamarin/public/_build/results?buildId=40929&view=logs&j=cfef19e4-4225-5e84-636a-86ba2231ac21&t=cd3bc6c3-ac29-5320-67c9-5fb59fc8e05c&l=732
dotnet/maui has hit some build failures such as:
error XARSD7000: System.Xml.XmlException: Root element is missing.
error XARSD7000: at System.Xml.XmlTextReaderImpl.Throw (System.Exception e)
error XARSD7000: at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo (System.String res)
error XARSD7000: at System.Xml.XmlTextReaderImpl.ParseDocumentContent ()
error XARSD7000: at System.Xml.XmlTextReaderImpl.Read ()
error XARSD7000: at System.Xml.XmlReader.MoveToContent ()
error XARSD7000: at System.Xml.Linq.XElement.Load (System.Xml.XmlReader reader, System.Xml.Linq.LoadOptions options)
error XARSD7000: at System.Xml.Linq.XElement.Parse (System.String text, System.Xml.Linq.LoadOptions options)
error XARSD7000: at System.Xml.Linq.XElement.Parse (System.String text)
error XARSD7000: at Xamarin.Android.Tools.JdkInfo+<GetLibexecJdkPaths>d__56.MoveNext ()
error XARSD7000: at System.Linq.Enumerable+DistinctIterator`1[TSource].MoveNext ()
error XARSD7000: at System.Linq.Enumerable+SelectEnumerableIterator`2[TSource,TResult].MoveNext ()
error XARSD7000: at System.Linq.Enumerable+WhereSelectEnumerableIterator`2[TSource,TResult].ToArray ()
error XARSD7000: at System.Linq.Buffer`1[TElement]..ctor (System.Collections.Generic.IEnumerable`1[T] source)
error XARSD7000: at System.Linq.OrderedEnumerable`1+<GetEnumerator>d__3[TElement].MoveNext ()
error XARSD7000: at System.Linq.Enumerable+ConcatIterator`1[TSource].MoveNext ()
error XARSD7000: at System.Linq.Enumerable+SelectEnumerableIterator`2[TSource,TResult].MoveNext ()
error XARSD7000: at Xamarin.Android.Tools.AndroidSdkBase.GetValidPath (System.Func`2[T,TResult] pathValidator, System.String ctorParam, System.Func`1[TResult] getPreferredPath, System.Func`1[TResult] getAllPaths)
error XARSD7000: at Xamarin.Android.Tools.AndroidSdkBase.Initialize (System.String androidSdkPath, System.String androidNdkPath, System.String javaSdkPath)
error XARSD7000: at Xamarin.Android.Tools.AndroidSdkInfo..ctor (System.Action`2[T1,T2] logger, System.String androidSdkPath, System.String androidNdkPath, System.String javaSdkPath)
error XARSD7000: at Xamarin.Android.Tasks.MonoAndroidHelper.RefreshAndroidSdk (System.String sdkPath, System.String ndkPath, System.String javaPath, Microsoft.Build.Utilities.TaskLoggingHelper logHelper)
error XARSD7000: at Xamarin.Android.Tasks.ResolveSdks.RunTask ()
error XARSD7000: at Xamarin.Android.Tasks.AndroidTask.Execute ()
It looks like `JdkInfo.GetLibexecJdkPaths()` doesn't handle
`XmlException` and warn appropriately.
I don't have the *actual* output of `/usr/libexec/java_home -X` from
these machines, but I suspect it's printing some message before the
XML or no XML at all.1 parent 81519fe commit 79e3b97
File tree
16 files changed
+85
-1
lines changed- src/Xamarin.Android.Tools.AndroidSdk
- Properties
- xlf
16 files changed
+85
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
350 | 350 | | |
351 | 351 | | |
352 | 352 | | |
353 | | - | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
354 | 361 | | |
355 | 362 | | |
356 | 363 | | |
| |||
Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
133 | 136 | | |
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
20 | 25 | | |
21 | 26 | | |
22 | 27 | | |
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
20 | 25 | | |
21 | 26 | | |
22 | 27 | | |
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
20 | 25 | | |
21 | 26 | | |
22 | 27 | | |
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
20 | 25 | | |
21 | 26 | | |
22 | 27 | | |
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
20 | 25 | | |
21 | 26 | | |
22 | 27 | | |
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
20 | 25 | | |
21 | 26 | | |
22 | 27 | | |
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
20 | 25 | | |
21 | 26 | | |
22 | 27 | | |
0 commit comments