Skip to content

Conversation

@jonpryor
Copy link
Contributor

Context: https://developercommunity.visualstudio.com/t/illegal-character-exception-in-xamarinandroid-afte/1363149

Changes: dotnet/android-tools@554d45a...d92fc3e

  * dotnet/android-tools@d92fc3e: [Xamarin.Android.Tools.AndroidSdk] Probe for AdoptOpenJDK Locations (dotnet#115)
  * dotnet/android-tools@dca30d9: [Xamarin.Android.Tools.AndroidSdk] Probe for Zulu JDK (dotnet#114)
  * dotnet/android-tools@237642c: [Xamarin.Android.Tools.AndroidSdk] Probe for Microsoft OpenJDK dirs (dotnet#113)
  * dotnet/android-tools@e618e00: [Xamarin.Android.Tools.AndroidSdk] Fix quotes in %PATH% or %PATHEXT% (dotnet#112)
@jonpryor
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Context: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=4666262&view=logs&j=54b9b405-417c-5884-5043-18b5f5d9acb9&t=ac76063e-e016-5aec-2585-53fde878edd6

The build is breaking:

	_BuildJava:
	  "/Users/runner/work/1/s/build-tools/gradle/gradlew" -d --stacktrace --no-daemon -PjavaSourceVer=1.8 -PjavaTargetVer=1.8 jar
	  …
	  [ERROR] [system.err] java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7
	  [ERROR] [system.err] 	at org.codehaus.groovy.vmplugin.VMPluginFactory.<clinit>(VMPluginFactory.java:43)

Java.Interop/main builds using adoptopenjdk-8.jdk, while this build
is failing with adoptopenjdk-14, as inferred from:

	gcc -g -shared -m64 -fPIC -o bin/TestRelease/libNativeTiming.dylib tests/NativeTiming/timing.c
	  -I/Library/Java/JavaVirtualMachines/adoptopenjdk-14.jdk/Contents/Home/include
	  -I/Library/Java/JavaVirtualMachines/adoptopenjdk-14.jdk/Contents/Home/include/darwin

Build with `make prepare all JI_MAX_JDK=11`, so that we avoid
AdoptOpenJDK 14.
@jonpryor jonpryor force-pushed the jonp-bump-xat-d92fc3e3 branch 2 times, most recently from b46d501 to 73e64dc Compare April 19, 2021 19:49
XML output changed between JDK 8 and JDK 11, breaking some unit tests.

Constrain CI to using JDK 8, so that tests pass.

Additionally, *for consistency*, update `TestJVM` to look for
`JdkInfo.props`.  If found, use the `$(JdkJvmPath)` value at
`/Project/Chooose/When/PropertyGroup/JdkJvmPath` instead of using
`JdkInfo.GetKnownSystemJdkInfos()`, so that the JVM that we built
against is also used for unit test execution.
@jonpryor jonpryor force-pushed the jonp-bump-xat-d92fc3e3 branch from 73e64dc to 2eb540c Compare April 19, 2021 23:11
@jonpryor
Copy link
Contributor Author

Squash-and-merge:

Summary:

Bump to xamarin/xamarin-android-tools/main@d92fc3e3 (#823)

Body:

Context: https://developercommunity.visualstudio.com/t/illegal-character-exception-in-xamarinandroid-afte/1363149

Changes: https://github.com/xamarin/xamarin-android-tools/compare/554d45a166a02da0ca1d0d9ca895eaa650fb648a...d92fc3e3a27e8240551baa813b15d6bf006a5620

  * xamarin/xamarin-android-tools@d92fc3e: [Xamarin.Android.Tools.AndroidSdk] Probe for AdoptOpenJDK Locations (#115)
  * xamarin/xamarin-android-tools@dca30d9: [Xamarin.Android.Tools.AndroidSdk] Probe for Zulu JDK (#114)
  * xamarin/xamarin-android-tools@237642c: [Xamarin.Android.Tools.AndroidSdk] Probe for Microsoft OpenJDK dirs (#113)
  * xamarin/xamarin-android-tools@e618e00: [Xamarin.Android.Tools.AndroidSdk] Fix quotes in %PATH% or %PATHEXT% (#112)

Finally, *prefer* JDK 8, as hilarious as that is, for two reasons:

 1. `gradlew` fails to execute when running under OpenJDK 14:

        [ERROR] [system.err] java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7

 2. The unit tests added in 69e1b80a currently depend upon the XML
    formatting conventions of JDK 8, and the tests fail when running
    under JDK 11 because of whitespace changes in `javax.xml` output.

For now, it's currently easier to just require JDK 8.

The preferred JDK version is controlled by the new `$(MaxJdkVersion)`
YAML variable, which in turn sets `$(JI_MAX_JDK)` (55c56f7a) and/or
the `$(MaxJdkVersion)` MSBuild property, which
`dotnet build -t:Prepare` uses to generate `bin/Build*/JdkInfo.props`.

Finally, *for consistency*, update `TestJVM` to look for the generated
`JdkInfo.props`.  If found, use the `$(JdkJvmPath)` value at
`/Project/Chooose/When/PropertyGroup/JdkJvmPath` instead of using
`JdkInfo.GetKnownSystemJdkInfos()`, so that the JVM that we built
against is also used for unit test execution.

@jonpryor jonpryor requested a review from jpobst April 20, 2021 00:10
Copy link
Contributor

@jpobst jpobst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the warning in a future XAT PR 😉

external\xamarin-android-tools\src\Xamarin.Android.Tools.AndroidSdk\Jdks\JdkLocations.Windows.cs(42,24): Warning CS0168: The variable 'e' is declared but never used

@jonpryor
Copy link
Contributor Author

future XAT PR: dotnet/android-tools#116

@jonpryor jonpryor merged commit 002dea4 into dotnet:main Apr 20, 2021
@jpobst jpobst added this to the 11.3 (16.10 / 8.10) milestone May 5, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants