Repository navigation
Remove obsolete native preflight helpers - #2095
Merged
Merged
Conversation
shimat
force-pushed
the
remove-obsolete-native-preflight
branch
from
July 26, 2026 10:27
97cf260 to
428e0d9
Compare
shimat
force-pushed
the
remove-obsolete-native-preflight
branch
from
July 26, 2026 11:08
428e0d9 to
7862df6
Compare
shimat
marked this pull request as ready for review
July 26, 2026 11:31
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
💤 Files with no reviewable changes (2)
📝 WalkthroughWalkthroughThe change removes explicit native-loading and silent error-handler helpers, updates native-library resolver and migration documentation, and adds full crash-dump collection to ARM64 test workflow failures. ChangesNative loading behavior
ARM64 crash diagnostics
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
NativeMethods.LoadLibraries()andNativeMethods.TryPInvoke()from OpenCvSharp5LoadLibraries()Cv2.GetVersionString()only when eager validation is usefulThis PR now targets
mainafter its original parent, #2094, was merged.Why
OpenCvSharp5 runtime packages already use the standard
runtimes/{rid}/nativelayout, so the .NET runtime resolvesOpenCvSharpExternon the first ordinary API call. The helpers duplicated that behavior, exposed an internal pre-flight API without adding loader guarantees, and installed an error callback whose only effect was suppressing OpenCV's stderr diagnostics. Native exceptions continue to propagate through the existingcvTry/core_getLastExceptionpath.The first Linux ARM64 CI run after rebasing crashed with exit code 139 during testhost teardown after all 698 tests had completed (679 passed and 19 skipped). The same code had passed in the preceding run, the parent PR's ARM64 job passed, every other platform passed, and rerunning the failed job also passed. No implementation change was indicated, but the workflow previously discarded its TRX and did not enable crash blame or upload a dump. The added diagnostics ensure the next intermittent crash leaves an executed-test sequence and native dump.
Impact
Most applications require no replacement. Hosts that keep the native library in a nonstandard location should register
NativeLibrary.SetDllImportResolverfortypeof(NativeMethods).Assemblybefore the first OpenCvSharp API call. Applications that want eager validation can callCv2.GetVersionString().OpenCvSharp4 is unchanged.
Validation
cmake --build src/build --config Release --target OpenCvSharpExterndotnet build src/OpenCvSharp/OpenCvSharp.csproj -c Release --no-restoredotnet test test/OpenCvSharp.Tests/OpenCvSharp.Tests.csproj -c Release --no-restore --filter "FullyQualifiedName~OpenCvSharp.Tests.ExceptionTest"(5 passed)docfx docs/docfx/docfx.json(0 errors; 2 pre-existing duplicate-source warnings)git diff --checkSummary by CodeRabbit
Documentation
Bug Fixes