Skip to content

Build MediaInfoLib for WebAssembly and analyze streams in chunks - #13

Merged
simonebortolin merged 4 commits into
masterfrom
ccr-5c8d7d65-2wuyn3
Nov 14, 2026
Merged

simonebortolin merged 4 commits into
masterfrom
ccr-5c8d7d65-2wuyn3

Conversation

@simonebortolin

@simonebortolin simonebortolin commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner
  • build-native-wasm.sh compiles MediaInfoLib and ZenLib with the Emscripten SDK from the .NET wasm-tools workload.
    • It uses the same toolchain and -fwasm-exceptions/SIMD flags as the runtime.
    • The output goes to native/browser-wasm/libmediainfo.a.
    • zlib comes from the .NET runtime.
    • SIZE_T_IS_LONG is needed on wasm32.
  • The logical P/Invoke library is now "libmediainfo", because the WebAssembly SDK binds imports by the archive file name. Desktop still goes through the resolver.
  • SharpMediaInfo.Native.Browser.targets adds the NativeFileReference. It is packed as buildTransitive, so NuGet consumers link it automatically.
  • OpenStream no longer copies the whole stream into memory.
    • It feeds 256 KB chunks and follows Open_Buffer_Continue_GoTo_Get seek requests.
    • The new OpenStreamAsync and MediaInfoBuilder.BuildAsync use Stream.ReadAsync.
  • Packing fix: natives were also packed as content/ and contentFiles/ entries, which made NuGet restore fail for consumers.
  • SharpMediaInfo.Wasm.Smoke runs MediaInfo inside the .NET wasm runtime under Node. CI builds the browser-wasm native and runs the smoke test before packing.
  • CI changes:
    • Pushes to release/* maintenance branches also tag and publish. Those releases are not marked as Latest.
    • The pack job fails if a package has contentFiles/, content/ or '..' entries.
  • The version is now 26.10.3. 26.10.2 is the packaging fix alone, released from release/26.10. The same fix is backported as 26.5.1, 26.1.1 and 25.10.2.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SyVioAMhEw3uuqBekTJcn2

- build-native-wasm.sh compiles MediaInfoLib + ZenLib with the Emscripten SDK
  of the .NET wasm-tools workload (same toolchain and -fwasm-exceptions/SIMD
  flags as the runtime) into native/browser-wasm/libmediainfo.a; zlib comes
  from the .NET runtime. SIZE_T_IS_LONG is needed on wasm32.
- The logical P/Invoke library is now "libmediainfo": the WebAssembly SDK binds
  imports by the archive file name (desktop still goes through the resolver).
- SharpMediaInfo.Native.Browser.targets adds the NativeFileReference; it is
  packed as buildTransitive so NuGet consumers link it automatically.
- OpenStream no longer copies the whole stream in memory: it feeds 256 KB
  chunks and follows Open_Buffer_Continue_GoTo_Get seek requests. New
  OpenStreamAsync / MediaInfoBuilder.BuildAsync use Stream.ReadAsync.
- Fix packing: natives were also packed as contentFiles with a
  build/../native path, which made NuGet restore fail for consumers.
- SharpMediaInfo.Wasm.Smoke runs MediaInfo inside the .NET wasm runtime under
  Node; CI builds the browser-wasm native and runs it before packing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SyVioAMhEw3uuqBekTJcn2
…10.3

Same CI changes as on the release/* maintenance branches: pushes to release/*
build, tag and publish (without becoming the Latest release), and the pack job
fails if a package has contentFiles or '..' entries. 26.10.2 is taken by the
release/26.10 packaging fix, so this goes out as 26.10.3.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SyVioAMhEw3uuqBekTJcn2
The runner image now ships a newer SDK that takes precedence over the one
setup-dotnet installs. With it the net10.0 smoke app would need
wasm-tools-net10 and WasmBuildNative isn't applied, and the browser-wasm
archive is compiled with that SDK's Emscripten. Pin the SDK with global.json in
the two wasm jobs and invalidate the browser-wasm native cache entry.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SyVioAMhEw3uuqBekTJcn2
setup-dotnet installs to /usr/share/dotnet on hosted runners, so the
$HOME/.dotnet glob matched nothing and ls exited 2, aborting the step
under bash -e -o pipefail before the PATH fallback ran.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SyVioAMhEw3uuqBekTJcn2
@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Pre-release removed now that this PR is closed.

@simonebortolin
simonebortolin added this pull request to stack #15 November 14, 2026 14:13
@simonebortolin
simonebortolin merged commit 7febbb0 into master Nov 14, 2026
37 checks passed
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