Conversation
R packages can be cross-compiled to WebAssembly by rwasm inside the webR container, which supplies Emscripten and a wasm-targeting LLVM flang. That makes R tools expressible as recipes, which matters because the catalogue currently has no statistics and no plotting at all. An R recipe differs from a C one in a way the schema has to carry: the build produces no per-operation binary. The artifact is a package library plus the R scripts that drive it, so an operation's `bin` names a script shipped with the recipe rather than something the build compiles. `packages` takes pkgdepends references, `dependencies` is passed through to add_pkg() (whose own default of FALSE builds no dependencies at all, so anything with hard dependencies needs NA), and webrVersion pins the toolchain per recipe exactly as emscriptenVersion does, because wasm binaries are only loadable by the webR release they were built against. Also require that a declared strategy carries its own settings block. A recipe could previously name emscripten and omit the emscripten block, validate cleanly, and fail much later in the build with a KeyError naming nothing the author would recognise. auto is exempt, since it legitimately accepts either block. This is inert on the current catalogue: all 31 recipes produce an unchanged verdict, and all nine emscripten recipes already carry their block.
This was referenced Aug 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
R packages can be cross-compiled to WebAssembly by
rwasminside the webR container, which supplies Emscripten and a wasm-targeting LLVM flang. That makes R tools expressible as recipes — which matters because the catalogue's operations currently contain no statistics and no plotting at all, and R would also bring phylogenetics and diversity analysis.This is the schema half only: it lets a recipe declare an R build. The builder that acts on it is a separate change.
What an R recipe declares
An R recipe differs from a C one in a way the schema has to carry: the build produces no per-operation binary. The artifact is a package library plus the R scripts that drive it, so an operation's
binnames a script shipped with the recipe rather than something the build compiles.Three details worth flagging for review:
dependenciesdefaults to nothing.rwasm::add_pkg()'s own default isFALSE, which builds no dependencies at all — not what the name suggests, and the upstream vignette still documents the opposite. Anything with hard dependencies needsNA.webrVersionpins the toolchain per recipe, exactly asemscriptenVersiondoes for the emscripten strategy. This is not optional in practice: wasm binaries are only loadable by the webR release they were built against.packagesrequires at least one entry, the first being the package an operation script is expected tolibrary().Also: require a strategy to carry its settings
A recipe could previously declare
strategy: emscriptenwith noemscripten:block, validate cleanly, and then fail deep in the build with aKeyErrornaming nothing the recipe author would recognise.validate_wasm_strategycloses that.autois exempt, since it tries biowasm first and falls back to emscripten and so legitimately accepts either block.Verification
rblock, emptypackages, missingwebrVersion, an invaliddependenciesvalue, andemscriptenwithout its block.allow-native-only-recipes(Allow a recipe to declare only a native build #25) andinput-sidecar-mode(Add a sidecar input mode for files located by name #26). The new function is placed aftervalidate_output_mode, andcheck_withafter theschemablock, specifically to stay out of the region those branches edit.sbom-implementation, which insertsvalidate_source_identityin the same place. The two are semantically independent — it is pure adjacency and resolves by keeping both functions — but whichever lands second will have to resolve it.Review notes
strategy: ryet, so nothing changes for the current catalogue on merge.Merge order
#29 is stacked on this one and should merge after it.
sbom-implementationis the priority branch and rewrites parts of the builders. This PR conflicts with it onhub/validate/validate.py— pure adjacency, both functions are kept. Rebase after it lands.