Skip to content

Fix native-library test discovery and oneDAL dependency copying - #7867

Draft
svick wants to merge 2 commits into
dotnet:mainfrom
svick:fix/native-library-test-discovery
Draft

svick wants to merge 2 commits into
dotnet:mainfrom
svick:fix/native-library-test-discovery

Conversation

@svick

@svick svick commented Oct 29, 2026

Copy link
Copy Markdown
Member

Stacking

Stacked on #7704. This PR intentionally includes that PR's commits and targets main; #7704 should be merged first. The two additional commits separate the functional fixes from the attribute-message changes.

Changes

  • Use the runtime's assembly-aware native loader on modern .NET, avoiding false Linux availability checks caused by the legacy libdl import and distro-specific RID probing. Retain the .NET Framework fallback, honor NUGET_PACKAGES, and resolve dependencies beside explicitly loaded Windows DLLs.
  • Reuse the oneDAL/TBB dependency list in Native.proj for native staging, packaging, and test/build-publish copying, instead of duplicating platform-specific filenames.
  • Add native-loading regression tests that fail when required dependencies cannot load, while preserving existing architecture and macOS exclusions. Make legacy wrapper implementation details private and remove unused members.
  • In a separate second commit, clarify native-dependent test skip messages without changing their availability conditions.

Validation

  • Native-loading regression tests pass on Windows .NET 8 and .NET Framework 4.8: four passed on each framework, zero skipped. The existing OneDalFastTreeBinaryEstimator test also passed on both frameworks after fixing its dependencies.
  • An isolated Ubuntu 24.04 WSL probe successfully loaded LightGBM, TensorFlow, and ONNX Runtime from the NuGet cache without app-local native copies, and rejected a nonexistent library. This local probe used .NET 11 preview, not the CI image/runtime.
  • Before/after native package inventories have identical paths and SHA-256 hashes for all 21 Windows package assets. Test-copy paths are unchanged by the dependency-list refactor, and publish copying includes all four oneDAL/TBB dependencies.
  • Verified excluded architecture/project gates and the Linux dependency query/test-copy paths under WSL.

The native-loading failures also affect conditional trainer coverage inside ONNX conversion tests, not only tests reported as skipped.

svick and others added 2 commits October 30, 2026 18:11
Use assembly-aware runtime loading on modern .NET, preserve the legacy fallback, and copy oneDAL/TBB dependencies using Native.proj's shared asset list. Add native-loading regression coverage and narrow the legacy wrapper's API.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 0c982995-379f-4379-bcb7-dba5d1102bb4
Describe supported platforms and loadable native dependencies rather than reporting every native-loading failure as an architecture restriction. Leave the availability conditions unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 0c982995-379f-4379-bcb7-dba5d1102bb4
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.

1 participant