Skip to content

[Java.Interop] Remove unused Mono native validation dependencies - #13054

Merged
simonrozsival merged 3 commits into
mainfrom
simonrozsival-native-mono-adapter-cleanup
Oct 10, 2026
Merged

simonrozsival merged 3 commits into
mainfrom
simonrozsival-native-mono-adapter-cleanup

Conversation

@simonrozsival

@simonrozsival simonrozsival commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Follow up to #13030.

JavaInterop1 retirement leaves java-interop-mono.cc without any code and
java-interop-mono.h with only Mono header imports. Native validation still
compiles that empty adapter and downloads a host Mono runtime pack pinned
to 8.0.13 solely for those unused headers.

Remove the empty adapter/header, CMake source/include wiring, Mono path
properties and arguments, and runtime-pack download. Also remove the
unused Mono configuration overrides, dead MonoInfo.props import, and
orphaned mono.mk file. No tracked reference, dynamic/wildcard include,
or documented entry point consumes that Make fragment.

Keep the native validation project and compilation of the shared dlfcn,
utility, and core sources. Archive paths, native source/header inputs,
incremental behavior, and clean behavior remain unchanged. Generic native
toolchain scripts and Android runtime/native-host CMake are untouched.

The third-party-notice audit requires no changes: the removed runtime pack
is Microsoft-owned and build-only, and the Java.Interop notice remains.

Local validation

All commands below passed on macOS arm64; builds reported zero warnings
and errors. For the isolated builds, NUGET_PACKAGES and
NUGET_HTTP_CACHE_PATH pointed to fresh, private cache directories without
removing or modifying shared/global packages.

Command Result
dotnet restore external/Java.Interop/src/java-interop/java-interop.csproj -p:BaseIntermediateOutputPath=obj/no-mono/ -v:minimal Passed; isolated cache contains only NoTargets and .NET analyzers, with no Mono runtime pack.
dotnet build external/Java.Interop/src/java-interop/java-interop.csproj --no-restore -p:BaseIntermediateOutputPath=obj/no-mono/ -v:minimal Passed; Debug arm64 archive contains exactly the three active source objects.
dotnet build external/Java.Interop/src/java-interop/java-interop.csproj -c Release -p:BaseIntermediateOutputPath=obj/no-mono/ -v:minimal Passed; Release arm64 archive.
dotnet build external/Java.Interop/src/java-interop/java-interop.csproj -p:BaseIntermediateOutputPath=obj/no-mono-x64/ -p:NETCoreSdkRuntimeIdentifier=osx-x64 -v:minimal Passed; x86_64 archive verified with lipo.
dotnet clean external/Java.Interop/src/java-interop/java-interop.csproj -v:minimal Passed; default validation archive removed.
dotnet build external/Java.Interop/src/java-interop/java-interop.csproj --no-restore -v:minimal Passed after clean and on the unchanged subsequent build; also passed after deleting mono.mk.

Additional local checks passed: all three source files, four headers,
CMakeLists.txt, the project, and its targets invalidate _BuildLibs when
touched; unchanged builds skip that target and preserve the archive
mtime; clean and missing-output builds recreate the archive. Fresh
CMake/Ninja configuration, output-directory override, incremental build,
and clean/rebuild also passed. Restore graphs, active compiler header
dependencies, and compile commands contain no Mono dependency.

Ad hoc native smoke checks linked against the arm64 and x64 archives and
passed strdup/free and dynamic-library load/symbol/close success and error
cases; x64 execution used Rosetta. Edited XML and git diff --check passed.
No new unit-test infrastructure is added for this unused-code removal.
Windows/MSVC and Linux hosts were unavailable locally and remain untested.
No full Android SDK/device build was run: active runtime sources and Android
CMake behavior are unchanged.


Pull Request
title and
description
should follow the
commit-messages.md workflow documentation, and in particular should include:

  • Useful description of why the change is necessary.
  • Links to issues fixed
  • Unit tests

simonrozsival and others added 2 commits October 9, 2026 23:25
Keep native source validation for the shared dynamic-loading, utility, and core sources without downloading Mono runtime packs or importing Mono headers. Remove obsolete header configuration and document the validation build contract.

Co-authored-by: Copilot App <[email protected]>
No tracked Makefile includes this fragment, including through dynamic or wildcard includes, and there is no documented entry point. Native validation uses dotnet and CMake independently.

Co-authored-by: Copilot App <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 9, 2026 21:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The cleanup is internally consistent, with only a non-blocking documentation maintainability suggestion.

1 open finding
What changed in this PR

Removes obsolete Mono dependencies from Java.Interop native validation while preserving active native compilation and incrementality.

Changes:

  • Removes empty Mono adapter files and CMake wiring.
  • Eliminates obsolete Mono package, properties, and build scripts.
  • Documents Mono-free native validation.
File Description
java-interop.targets Removes Mono include arguments.
java-interop.csproj Removes Mono runtime-pack download.
java-interop-mono.h Deletes unused Mono header adapter.
java-interop-mono.cc Deletes empty source adapter.
CMakeLists.txt Removes Mono includes and source.
BuildConfiguration.md Documents native validation.
Directory.Build.props Removes obsolete MonoInfo.props import.
Configuration.Override.props.in Removes Mono overrides.
mono.mk Deletes orphaned Mono probing script.

🧠 Review effort: Balanced

Comment thread external/Java.Interop/Documentation/BuildConfiguration.md Outdated
Keep the configuration guide focused on useful settings instead of documenting internal validation output details or the absence of a removed dependency.

Co-authored-by: Copilot App <[email protected]>
@simonrozsival

Copy link
Copy Markdown
Member Author

@dalexsoto review

@dalexsoto dalexsoto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The removed Mono adapter, headers, package and build-script wiring have no active consumer. Native validation retains its three support sources, platform/output paths and incremental/Clean contracts, while Android runtime linking remains separate and unchanged. No blocking issue remains.

@simonrozsival
simonrozsival enabled auto-merge (squash) October 10, 2026 09:34
@simonrozsival
simonrozsival merged commit 2223854 into main Oct 10, 2026
42 checks passed
@simonrozsival
simonrozsival deleted the simonrozsival-native-mono-adapter-cleanup branch October 10, 2026 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants