Skip to content

Fix: Correct WASM library filename from libOpenCvSharpExtern.a to OpenCvSharpExtern.a#1838

Closed
asheesh1996 wants to merge 1 commit intoshimat:mainfrom
asheesh1996:main
Closed

Fix: Correct WASM library filename from libOpenCvSharpExtern.a to OpenCvSharpExtern.a#1838
asheesh1996 wants to merge 1 commit intoshimat:mainfrom
asheesh1996:main

Conversation

@asheesh1996
Copy link

@asheesh1996 asheesh1996 commented Mar 7, 2026

Description

Fixes the NativeFileReference error in the WASM runtime package build caused by a filename mismatch.

Problem

The emcmake/cmake build outputs OpenCvSharpExtern.a (without 'lib' prefix), but the project configuration was referencing libOpenCvSharpExtern.a, causing:

Error: Could not find NativeFileReference C:\Users\...\runtimes\browser-wasm\4.0.23\OpenCvSharpExtern.a

Changes

  • .github/workflows/wasm.yml: Updated copy command from libOpenCvSharpExtern.aOpenCvSharpExtern.a
  • nuget/OpenCvSharp4.runtime.wasm.csproj: Updated NativeFileReference path from libOpenCvSharpExtern.aOpenCvSharpExtern.a
  • Ensured all files comply with UTF-8 with BOM encoding per contributing guidelines

Testing

This fix resolves the WASM runtime package build error where the NativeFileReference could not locate the compiled library file.

Summary by CodeRabbit

  • Chores
    • Updated WebAssembly runtime package artifact naming and distribution configuration.

…nCvSharpExtern.a

The emcmake/cmake build outputs OpenCvSharpExtern.a (without 'lib' prefix), but
the project configuration was referencing libOpenCvSharpExtern.a, causing a
NativeFileReference error in the WASM runtime package build.

Changes:
- Update .github/workflows/wasm.yml: Fix copy command filename
- Update nuget/OpenCvSharp4.runtime.wasm.csproj: Fix NativeFileReference path

This resolves the error:
'Could not find NativeFileReference ...\OpenCvSharpExtern.a'
@coderabbitai
Copy link

coderabbitai bot commented Mar 7, 2026

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: 633298bd-d6af-434c-9eb9-cbdc6ff6c271

📥 Commits

Reviewing files that changed from the base of the PR and between cc75bb9 and 393af70.

📒 Files selected for processing (2)
  • .github/workflows/wasm.yml
  • nuget/OpenCvSharp4.runtime.wasm.csproj

📝 Walkthrough

Walkthrough

The PR updates WASM build artifacts and packaging configuration. The artifact filename changes from libOpenCvSharpExtern.a to OpenCvSharpExtern.a in both the GitHub Actions workflow build process and the NuGet package runtime specification.

Changes

Cohort / File(s) Summary
WASM Workflow Build Configuration
.github/workflows/wasm.yml
Updated the build step to copy OpenCvSharpExtern.a instead of libOpenCvSharpExtern.a. Note: A BOM/hidden character was introduced in the workflow header.
WASM NuGet Package Specification
nuget/OpenCvSharp4.runtime.wasm.csproj
Changed the packaged artifact from libOpenCvSharpExtern.a to OpenCvSharpExtern.a in the browser-wasm runtime reference path, affecting the distributed binary artifact name.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • Refactor wasm CI #1835: Modifies the Wasm CI workflow's OpenCvSharpExtern build/copy step, directly related to the workflow artifact path changes.
  • Fix wasm path #1822: Updates the wasm runtime reference for OpenCvSharpExtern.a, addressing the same artifact naming in the NuGet package specification.
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically describes the main change: correcting the WASM library filename references from the incorrect lib-prefixed name to the actual compiled artifact name.
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
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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

@shimat
Copy link
Owner

shimat commented Mar 8, 2026

Thank you for the report! The actual mismatch is in OpenCvSharp4.runtime.wasm.props, which referenced OpenCvSharpExtern.a — but CMake (including Emscripten) always outputs libOpenCvSharpExtern.a for add_library(OpenCvSharpExtern STATIC ...). The correct fix is to update wasm.props to use libOpenCvSharpExtern.a. I've opened PR #1839 with this change.

@shimat shimat closed this in #1839 Mar 8, 2026
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.

2 participants