Skip to content

DO NOT MERGE: Build against c2pa-rs main (nightly) - #270

Draft
scouten-adobe wants to merge 3 commits into
mainfrom
scouten-adobe-test-c2pa-rs-main-nightly
Draft

scouten-adobe wants to merge 3 commits into
mainfrom
scouten-adobe-test-c2pa-rs-main-nightly

Conversation

@scouten-adobe

@scouten-adobe scouten-adobe commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

DO NOT MERGE — c2pa-rs main compatibility probe

Build c2pa-c-ffi from source from contentauth/c2pa-rs main to detect incompatibilities ahead of the mid-November breaking-changes release. This remains a draft / DO NOT MERGE experiment.

CI logs the actual Rust commit and toolchain versions. The redundant initial prebuilt-binary configure step has been removed; the existing Makefile configures source builds for debug and sanitizer tests.

Latest compatibility check (2026-10-16)

Checked against contentauth/c2pa-rs commit 60f7cbdc69ab7a2554fcc87eb4df77050814b2cf (0.92.0-dev), confirmed to be main at the time of the check. Local platform: macOS arm64, AppleClang 21, Cargo 1.98.1.

Original result: incompatible. The Rust release library built, but deleted APIs and opaque stream handles prevented C/C++ compilation. Commit c1a0855 addresses those failures, and the complete platform CI matrix now passes.

API migration

User-directed choice: migrate to supported APIs and remove obsolete methods rather than add a compatibility layer.

Former blocker Resolution
Opaque C2paStream C++ wrappers use composition; the C test owns its FILE and opaque stream separately.
Deleted c2pa_load_settings Removed c2pa::load_settings; use explicit Context settings instead. Migrated settings-dependent tests and documentation.
Deleted builder/reader constructors Existing context-free C++ constructors remain as adapters that create a default Context and call supported APIs. C integration tests use context + with_definition, with_archive, and with_stream.
Deleted data-hashed signing functions Removed Builder::data_hashed_placeholder and Builder::sign_data_hashed_embeddable. Use a Context signer, placeholder, set_data_hash_exclusions, update_hash_from_stream, and sign_embeddable. The old external precomputed DataHash JSON argument has no drop-in replacement.
Deleted c2pa_format_embeddable Retained C++ Builder::format_embeddable using c2pa_builder_compose_manifest.
Deleted c2pa_signature_free Use c2pa_free.

The embeddable tests now embed actual JPEG/PNG placeholders, compute exclusions and hashes, patch the exact-size final manifest, and verify readback. JPEG coverage includes replacement of existing JUMBF, metadata preservation, raw-manifest formatting, and detection of tampering outside exclusions. BoxHash coverage remains.

Also fixed source-build infrastructure: declare/copy generated headers and Windows import libraries, link the C test to the proper import library, initialize MSVC for both Windows architectures, and avoid a prebuilt-only diagnostic test for source builds.

Compatibility notes

This intentionally changes the public C++ API: load_settings and the two old data-hashed signing methods are removed. Context-free constructors no longer read thread-local settings. Pass explicit Context objects for non-default configuration. Stream wrappers no longer inherit from the C ABI stream type; use their existing c_stream member.

Validation

  • macOS arm64: library, tests, and examples build against the checked Rust main revision.
  • Full debug suite: all 363 C++ tests and the C integration test pass.
  • Default released 0.91.0 dependency: library, tests, and examples still compile.
  • Full ASan/UBSan suite: all 363 C++ tests and the C integration test pass using AppleClang 21.
  • Homebrew LLVM 19's ASan runtime hangs during initialization on this macOS 26.6.2 host, before test code runs (confirmed by process sampling); both test executables hit the 180-second timeout. Rebuilding with the installed AppleClang runtime resolves this local tooling issue.
  • CI run 38970848917: all eight platform jobs pass for c1a0855: Windows x64/arm64, macOS arm64/Intel, Ubuntu latest and 22.04 x64, and Ubuntu 22.04/24.04 arm64. Debug suites pass everywhere; sanitizer suites pass on Linux and macOS (skipped on Windows by the existing workflow).

Local reproduction

mkdir -p target
git clone --depth 1 https://github.com/contentauth/c2pa-rs.git target/c2pa-rs
cmake -S . -B build/nightly -G Ninja \
  -DCMAKE_BUILD_TYPE=Debug \
  -DC2PA_BUILD_FROM_SOURCE=ON \
  -DC2PA_RS_PATH="$PWD/target/c2pa-rs"
cmake --build build/nightly
ctest --test-dir build/nightly --output-on-failure

Earlier failed CI runs predate the migration fixes.

scouten-adobe and others added 2 commits October 14, 2026 11:58
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Replace deleted constructors and settings APIs, adapt opaque streams, and migrate embeddable signing to context signers. Fix source-build artifacts and Windows toolchain setup.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant