Skip to content

Fix linux-arm RID: rename NuGet package to linux-arm64, keep shim for compatibility - #1871

Merged
shimat merged 3 commits into
mainfrom
fix/linux-arm-rid
May 23, 2026
Merged

Fix linux-arm RID: rename NuGet package to linux-arm64, keep shim for compatibility#1871
shimat merged 3 commits into
mainfrom
fix/linux-arm-rid

Conversation

@shimat

@shimat shimat commented May 23, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes #1870.

The OpenCvSharp4.runtime.linux-arm NuGet package placed native binaries under
runtimes/linux-arm/native/, but the CI has always built on ARM64 hardware
(ubuntu-24.04-arm) and tested with --runtime linux-arm64. In the .NET RID graph,
linux-arm (32-bit ARMv7) and linux-arm64 (64-bit AArch64) are siblings, not
parent/child
, so .NET never automatically resolves runtimes/linux-arm/native/ when
running on linux-arm64 targets — the native library was silently not copied.

Changes

  • nuget/OpenCvSharp4.runtime.linux-arm64.csproj — New package with the correct runtimes/linux-arm64/native/ path.
  • nuget/OpenCvSharp4.runtime.linux-arm.csproj — Converted to a compatibility shim: native .so removed, replaced with a PackageReference dependency on linux-arm64. Existing users who reference the old package name will automatically get the real library.
  • .github/workflows/linux-arm.ymllinux-arm64.yml — Renamed and updated to pack both the new linux-arm64 package and the shim. Artifact name changed to artifacts_linux_arm64.
  • .github/workflows/publish_nuget.yml — Updated workflow and artifact references.
  • nuget/README.runtime.md / README.md — Package table updated; deprecation note added for linux-arm.

Reviewer notes

  • The shim package carries a minimum-version dependency on linux-arm64 at the same version, so existing projects require no code changes — NuGet will resolve the correct native library automatically.
  • The OpenCV cache key in the workflow now hashes linux-arm64.yml instead of linux-arm.yml; the existing cache will be invalidated once on the first run after merge, which is expected and harmless.

Summary by CodeRabbit

  • New Features

    • Added native runtime support for Linux ARM64 (AArch64).
  • Documentation

    • Announced the new Linux ARM64 runtime package and clarified that the prior Linux ARM package is retained as a deprecated compatibility shim redirecting to the ARM64 package; guidance updated to reference the ARM64 package for new projects.

Review Change Stack

…tibility

The native binary has always been built for ARM64 (AArch64), but the NuGet
package path was runtimes/linux-arm/native/ instead of runtimes/linux-arm64/native/.
These are siblings in the .NET RID graph, so .NET never automatically copied
the native library on linux-arm64 targets.

- Add OpenCvSharp4.runtime.linux-arm64 with correct runtimes/linux-arm64/native/ path
- Convert OpenCvSharp4.runtime.linux-arm to a compatibility shim that depends on linux-arm64
- Rename workflow linux-arm.yml -> linux-arm64.yml and update artifact names
- Update publish_nuget.yml, README.md, and nuget/README.runtime.md

Closes #1870

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@shimat shimat self-assigned this May 23, 2026
@shimat shimat changed the title Fix linux-arm RID: rename package to linux-arm64, keep shim for compa… Fix linux-arm RID: rename NuGet package to linux-arm64, keep shim for compatibility May 23, 2026
@coderabbitai

coderabbitai Bot commented May 23, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 99d59bc0-b059-4dce-badb-5916469722b6

📥 Commits

Reviewing files that changed from the base of the PR and between 5f0c663 and d3221c3.

📒 Files selected for processing (1)
  • nuget/README.runtime.md
💤 Files with no reviewable changes (1)
  • nuget/README.runtime.md

📝 Walkthrough

Walkthrough

This PR adds a new OpenCvSharp4.runtime.linux-arm64 NuGet package, converts the existing linux-arm package into a deprecated compatibility shim that references linux-arm64, updates CI workflows to build/publish ARM64 artifacts and cache keys, and updates README documentation accordingly.

Changes

Linux ARM64 Package Migration

Layer / File(s) Summary
New Linux ARM64 NuGet Package
nuget/OpenCvSharp4.runtime.linux-arm64.csproj
New .csproj targeting netstandard2.0/netstandard2.1/netcoreapp3.1 with package metadata and native asset declarations; packages libOpenCvSharpExtern.so into runtimes/linux-arm64/native/ plus icon and README.
Linux ARM Compatibility Shim
nuget/OpenCvSharp4.runtime.linux-arm.csproj
Updates package metadata to mark it as a deprecated compatibility shim, removes the ARM native libOpenCvSharpExtern.so from packaging, and adds a PackageReference to OpenCvSharp4.runtime.linux-arm64 (versioned by $(Version)).
Build and Publish Workflows
.github/workflows/linux-arm64.yml, .github/workflows/publish_nuget.yml
Workflow name changed to "Linux ARM64"; OpenCV cache keys updated to reference linux-arm64.yml; NuGet packaging script computes a date-based version, runs dotnet pack for both linux-arm64 and linux-arm projects into artifacts_arm64, uploads artifact as artifacts_linux_arm64; publish workflow downloads artifacts_linux_arm64.
Documentation Updates
README.md, nuget/README.runtime.md
Adds OpenCvSharp4.runtime.linux-arm64 entry to native bindings table and marks OpenCvSharp4.runtime.linux-arm as a deprecated compatibility shim; updates notes to explain the rename/shim behavior.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • shimat/opencvsharp#1834: Changes to OpenCV build caching key logic in workflow files, related to ARM/ARM64 cache-key updates.
  • shimat/opencvsharp#1831: Related adjustments to NuGet runtime packaging and inclusion of README.runtime.md in runtime packages.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: renaming the NuGet package from linux-arm to linux-arm64 while maintaining backward compatibility through a shim package.
Linked Issues check ✅ Passed All objectives from issue #1870 are fully met: package RID changed to linux-arm64, runtime path updated to runtimes/linux-arm64/native/, compatibility shim provided, and CI/workflows updated accordingly.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the linked issue #1870: NuGet project files, CI workflows, documentation updates, and README modifications—no unrelated changes detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/linux-arm-rid

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@nuget/README.runtime.md`:
- Around line 29-31: Remove the empty line between the two consecutive
blockquote notes in the README.runtime.md so the two "Note:" blockquotes are
adjacent (this resolves markdownlint MD028); specifically, delete the blank line
separating the blockquote mentioning OpenCvSharp4.official.runtime.* and the
blockquote mentioning OpenCvSharp4.runtime.linux-arm ->
OpenCvSharp4.runtime.linux-arm64 so both blockquotes form a single back-to-back
block without intervening blank lines.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 37915c69-6afc-4eb1-a3c4-fa28f317385a

📥 Commits

Reviewing files that changed from the base of the PR and between f25afda and 926835d.

📒 Files selected for processing (6)
  • .github/workflows/linux-arm64.yml
  • .github/workflows/publish_nuget.yml
  • README.md
  • nuget/OpenCvSharp4.runtime.linux-arm.csproj
  • nuget/OpenCvSharp4.runtime.linux-arm64.csproj
  • nuget/README.runtime.md

Comment thread nuget/README.runtime.md
shimat and others added 2 commits May 23, 2026 22:05
…-arm64

OpenCvSharp4.runtime.linux-arm64 does not yet exist on nuget.org, so
dotnet pack for the shim package fails during restore. Since the project
has NoBuild=true and only needs the dependency written to the nuspec,
--no-restore is sufficient.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@shimat
shimat merged commit 16ca2bc into main May 23, 2026
11 of 12 checks passed
@shimat
shimat deleted the fix/linux-arm-rid branch May 23, 2026 14:05
@shimat shimat added the bug Confirmed defect in OpenCvSharp label Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Confirmed defect in OpenCvSharp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change RID of OpenCvSharp4.runtime.linux-arm to linux-arm64

1 participant