Skip to content

Conversation

@akoeplinger
Copy link
Member

@akoeplinger akoeplinger commented Jan 2, 2017

Makes sure the build works with Mono master/4.9+.

@dnfclas
Copy link

dnfclas commented Jan 2, 2017

Hi @akoeplinger, I'm your friendly neighborhood .NET Foundation Pull Request Bot (You can call me DNFBOT). Thanks for your contribution!
You've already signed the contribution license agreement. Thanks!

The agreement was validated by .NET Foundation and real humans are currently evaluating your PR.

TTYL, DNFBOT;

<ItemGroup>
<Reference Include="System" />
<Reference Include="nunit.framework">
<HintPath>..\..\..\lib\NUnit-2.6.3\bin\nunit.framework.dll</HintPath>
Copy link
Contributor

Choose a reason for hiding this comment

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

...what? Java.Interop.Dynamic-Tests doesn't reference nunit.framework?

What's odd is that (1) it does here, and (2) this PR built with the PR builder, so I am very confused:

$ monodis --assemblyref bin/TestDebug/Java.Interop.Dynamic-Tests.dll
...
3: Version=2.6.3.13283
	Name=nunit.framework
	Flags=0x00000000
	Public Key:
0x00000000: 96 D0 9A 1E B7 F4 4A 77 

Copy link
Contributor

Choose a reason for hiding this comment

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

From the commit message:

the latter one is deprecated as of Mono 4.9.

I guess the problem is that nunit.framework.dll was present in mono, and in mono 4.9 it isn't anymore, which is why this used to work but now it doesn't.

Copy link
Member Author

@akoeplinger akoeplinger Jan 2, 2017

Choose a reason for hiding this comment

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

It's probably getting the reference from one of the projects that are referenced with my change.

I'll redo this leaving the reference in but just fix the the path.

Copy link
Member Author

@akoeplinger akoeplinger Jan 2, 2017

Choose a reason for hiding this comment

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

BTW nunit.framework.dll IS still present in Mono 4.9, it's just that types like TestFixtureAttribute have the Obsolete attribute applied with IsError=true (temporarily, to catch cases like this).

In this case I guess what happens is that since the HintPath doesn't exist it'll instead use the assembly from the GAC, which results in the obsolete error.

<Reference Include="System" />
<Reference Include="nunit.framework">
<HintPath>..\..\lib\NUnit-2.6.3\bin\nunit.framework.dll</HintPath>
<HintPath>..\..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
Copy link
Contributor

Choose a reason for hiding this comment

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

Changes like this make me wonder how this repo ever built... :-/

Make sure we're using the NuGet one instead of the GAC
since the latter one is deprecated as of Mono 4.9.
@akoeplinger akoeplinger force-pushed the fix-mono-master-build branch from 07eb607 to 0ce2535 Compare January 2, 2017 20:04
@akoeplinger
Copy link
Member Author

@jonpryor updated

@jonpryor jonpryor merged commit c73302c into dotnet:master Jan 3, 2017
@akoeplinger akoeplinger deleted the fix-mono-master-build branch January 3, 2017 12:58
jonpryor added a commit to jonpryor/java.interop that referenced this pull request Apr 19, 2021
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 added a commit that referenced this pull request Apr 20, 2021
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 (#115)
  * dotnet/android-tools@dca30d9: [Xamarin.Android.Tools.AndroidSdk] Probe for Zulu JDK (#114)
  * dotnet/android-tools@237642c: [Xamarin.Android.Tools.AndroidSdk] Probe for Microsoft OpenJDK dirs (#113)
  * dotnet/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 69e1b80 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)` (55c56f7) 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.
@github-actions github-actions bot locked and limited conversation to collaborators Apr 15, 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.

3 participants