Skip to content

Bump to xamarin/Java.Interop/main@3824b974 #5757

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

Merged
merged 11 commits into from
Mar 23, 2021

Conversation

jonpryor
Copy link
Contributor

@jonpryor jonpryor force-pushed the jonp-bump-ji-3824b974 branch from 0c2f37d to e127458 Compare March 18, 2021 12:09
@jonpryor jonpryor requested a review from grendello as a code owner March 18, 2021 12:09
@jonpryor jonpryor force-pushed the jonp-bump-ji-3824b974 branch from e127458 to a0eea8a Compare March 18, 2021 15:34
Fixes: dotnet/java-interop#790

Changes: dotnet/java-interop@bba1f07...3824b97

  * dotnet/java-interop@3824b974: [java-interop] Windows build system support (dotnet#816)
  * dotnet/java-interop@94c0c709: Bump to xamarin/xamarin-android-tools/main@554d45a (dotnet#813)
  * dotnet/java-interop@5c756b14: [Java.Interop-PerformanceTests] Support .NET Core 3.1 (dotnet#808)
  * dotnet/java-interop@daec07b6: [build] Fix various warnings (dotnet#812)
  * dotnet/java-interop@678c4bd2: [class-parse, generator] Allow showing Kotlin internals via metadata (dotnet#793)
  * dotnet/java-interop@cd4c8f80: [jnienv-gen] Generate a header file for the native functions (dotnet#809)
  * dotnet/java-interop@69767c1a: [param-name-importer] Fix NSE when updating JavaApi.AllPackages (dotnet#807)
  * dotnet/java-interop@a666a6f9: [Java.Runtime.Environment] Partial support for .NET Core (dotnet#804)

Note: dotnet/java-interop@3824b974 updated
Java.Interop/src/java-interop to use `_WINDOWS`, not `WINDOWS`.
Define `_WINDOWS` when building for Windows as well.
@jonpryor jonpryor force-pushed the jonp-bump-ji-3824b974 branch from a0eea8a to d9b4a4a Compare March 18, 2021 16:20
@jonpryor
Copy link
Contributor Author

All unit tests are green.

Windows doesn't build. Looks like vcvarsall.bat might not exist? https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=4570166&view=logs&j=cac0e8d3-0ef5-5d2b-b57e-e8fde7204df3&t=d0eaacf3-179f-5217-7519-cd03bc45e5e4

  call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat"  x86_amd64 && cmake -G "NMake Makefiles" -S "C:/a/1/s/external/Java.Interop/src/java-interop/" -B "C:/a/1/s/external/Java.Interop/src/java-interop/obj//Release/win-x64/" "-DJDK_INCLUDE_LIST=C:/Users/AzDevOps/android-toolchain/jdk-11/include;C:/Users/AzDevOps/android-toolchain/jdk-11/include/win32" "-DJNI_C_PATH=C:/a/1/s/external/Java.Interop/src/java-interop/obj//Release/jni.c" && cmake --build "C:/a/1/s/external/Java.Interop/src/java-interop/obj//Release/win-x64/" -v
  The system cannot find the path specified.

Context: dotnet#5757 (comment)

Windows fails to build because `call …\vcvarsall.bat` fails (presumably):

    call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat"  x86_amd64 && cmake -G "NMake Makefiles" -S "C:/a/1/s/external/Java.Interop/src/java-interop/" -B "C:/a/1/s/external/Java.Interop/src/java-interop/obj//Release/win-x64/" "-DJDK_INCLUDE_LIST=C:/Users/AzDevOps/android-toolchain/jdk-11/include;C:/Users/AzDevOps/android-toolchain/jdk-11/include/win32" "-DJNI_C_PATH=C:/a/1/s/external/Java.Interop/src/java-interop/obj//Release/jni.c" && cmake --build "C:/a/1/s/external/Java.Interop/src/java-interop/obj//Release/win-x64/" -v
    The system cannot find the path specified.

(That or `cmake` somehow isn't in `%PATH%`?!)

This only fails in the external\Java.Interop\src\java-interop build.

Update a "random" target in `Xamarin.Android.Build.Tasks.targets`
which *currently* (previously?) executed *before* `java-interop.csproj`,
in an effort to help diagnose what may be failing.

Does `vcvarsall.bat` exist?
<PropertyGroup>
<_HaveVcVars Condition=" Exists('C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat') ">True</_HaveVcVars>
</PropertyGroup>
<Message Text="# jonp: Does vcvarsall.bat exist? $(_HaveVcVars) " />
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need this message still?

<ItemGroup Condition=" '$(_HaveVcVars)' == '' And '$(OS)' == 'Windows_NT' ">
<_Vcvars Include="C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\**\vcvarsall.bat" />
</ItemGroup>
<Message Text="# jonp: Anywhere? @(_Vcvars, ';')" />
Copy link
Contributor

Choose a reason for hiding this comment

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

same here.

@jonpryor
Copy link
Contributor Author

Welp, this is disturbing:

Task "Message" (TaskId:1532)
  Task Parameter:Text=# jonp: Does vcvarsall.bat exist?   (TaskId:1532)
  # jonp: Does vcvarsall.bat exist?   (TaskId:1532)
Done executing task "Message". (TaskId:1532)
Task "Message" (TaskId:1533)
  Task Parameter:Text=# jonp: Anywhere?  (TaskId:1533)
  # jonp: Anywhere?  (TaskId:1533)

Apparently there is no vcvarsall.bat on this machine.

Does it have any VC files?

Commit ded44a8 asked if `vcvarsall.bat` exists.

No, it does not:

    Task "Message" (TaskId:1532)
      Task Parameter:Text=# jonp: Does vcvarsall.bat exist?   (TaskId:1532)
      # jonp: Does vcvarsall.bat exist?   (TaskId:1532)
    Done executing task "Message". (TaskId:1532)
    Task "Message" (TaskId:1533)
      Task Parameter:Text=# jonp: Anywhere?  (TaskId:1533)
      # jonp: Anywhere?  (TaskId:1533)

Thus I wonder, what kind of VC environment exists at all?

ADD MOAR LOGGING:

 1. Does `C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC`
    exist?  It presumably *should*; there's a `%VCTargetsPath%`
    environment variable in the build logs…

 2. If it does exist, what `*.bat` and `*.cmd` files exist?

Perhaps Java.Interop needs to use something other than `vcvarsall.bat`.
@jonpryor
Copy link
Contributor Author

Uh oh:

  # jonp: Does VC exist? True  (TaskId:1534)
  # jonp: Any scripts?
   (TaskId:1536)

The VC directory exists, but there's no .bat or .cmd files within it!

Hopefully this means/includes the VC++ toolchain?
Let's try `VisualStudioComponent.Microsoft_VisualStudio_Component_VC_Tools_x86_x64`?
jonpryor added a commit to jonpryor/java.interop that referenced this pull request Mar 22, 2021
Context: dotnet/android#5757

Turns Out™ that the xamarin-android Windows CI machine *doesn't* have
Visual C++ installed, and thus *can't* build `src/java-interop` with
the changes in 3824b97.  (Rephrased: 3824b97 broke the Windows
build for xamarin-android!)

Update `NativeToolchain.targets`, `src/java-interop`, and
`tests/NativeTiming` so that native files are *optional* when building
on Windows.  This should allow xamarin-android CI to work.
jonpryor added a commit to jonpryor/xamarin-android that referenced this pull request Mar 22, 2021
jonpryor added a commit to dotnet/java-interop that referenced this pull request Mar 22, 2021
Context: dotnet/android#5757

Turns Out™ that the xamarin-android Windows CI machine *doesn't* have
Visual C++ installed, and thus *can't* build `src/java-interop` with
the changes in 3824b97.  (Rephrased: 3824b97 broke the Windows
build for xamarin-android!)

Update `NativeToolchain.targets`, `src/java-interop`, and
`tests/NativeTiming` so that native files are *optional* when building
on Windows.  This should allow xamarin-android CI to work.
This reverts commit 072c65b.

Didn't work.
This reverts commit f5deace.

VC++ is *not* provisioned on this build machine.
Appease the Windows CI bots by *not building* `java-interop.dll`.
Context: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=4580378&view=ms.vss-test-web.build-test-results-tab&runId=19988886&resultId=100102&paneView=debug

`BuildReleaseArm64(True)` is failing.  I *think* it's due to a
"weird merge" with 952e67b, in that we're (somehow?) getting the
.net 6 runtime assemblies, not the pre-952e67be .apkdesc files?

For sanity, explicitly merge with master.  Let's see what happens.
@jonpryor jonpryor merged commit aa368a3 into dotnet:main Mar 23, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Jan 25, 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.

Allow metadata to work on Kotlin visibility
3 participants