c2pa-rs icon indicating copy to clipboard operation
c2pa-rs copied to clipboard

Clarify Wasm usage

Open crandmck opened this issue 11 months ago • 2 comments

Copying some comments on https://github.com/contentauth/c2pa-rs/pull/958 to here:

It would be great to add a sentence or two about WHY one would want to build Wasm. Also, is building Wasm required? If so, why? If one can omit it, how?

There are many supported LLVM targets for this crate and we don't have any language indicating why you would compile for them.

That's a good point. Perhaps we should! The docs don't currently mention LLVM at all, so we should add that, too.

We assume that most people who are using Python, C, or Node would use the libraries we create (from the Rust bindings), so they may not understand in what situations Wasm is required. Is it ONLY required if you're creating language bindings? Is it required for building the C library (for Python, Node, and client JS, you don't build, you just install a prebuilt package). Is it required for non-JS languages?

I admit I don't understand this clearly, and I suspect our users will be in the same boat.

The user will necessarily have a use case outside the scope of this crate and know which target to compile for. No one has to compile for any target if they don't want to.

Perhaps, but the more we can explain the better, especially since there are certainly many people without extensive experience with Rust who might want to at least understand their options.

Also, IIUC, one can use c2pa-rs directly (i.e. not for another language binding), e.g. if you want to call into Rust using the Foreign Function Interface (FFI). Maybe I'm misunderstanding.

I think we just need to explain the relationship between Wasm and c2pa-rs, because we only mention it in passing atm and it's likely to be more confusing than helpful.

crandmck avatar Mar 12 '25 17:03 crandmck

From @gpeacock https://github.com/contentauth/c2pa-rs/pull/958#discussion_r1992004688

Note that make test has always tried to build wasm, and that will no longer work on macs without installing llvm. We may want to reconfigure this and make wasm/wasi builds as separate step.

cdmurph32 avatar Mar 12 '25 17:03 cdmurph32

:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/CAI-10490 is successfully created for this GitHub issue.

github-jira-sync-bot avatar Dec 18 '25 01:12 github-jira-sync-bot