pampa - make quarto-system-runtime optional via filters feature#192
Conversation
Library consumers that only need the parser and writers could not build on Linux x86_64 as a `cdylib` because pampa unconditionally re-exported `unified_filter`, which pulls `quarto-system-runtime` → `deno_core` → the prebuilt v8 static archive. Linking v8's local-exec TLS into a shared object fails with `R_X86_64_TPOFF32`. Gate the filter pipeline behind a new `filters` feature: mark `quarto-system-runtime` optional, gate `pub mod citeproc_filter` and `pub mod unified_filter` on `feature = "filters"`, and route both `json-filter` and `lua-filter` through it. Default features are unchanged, so binaries and existing library consumers see the same dep graph. Parser-only consumers can opt out with `default-features = false`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Without any further inspection than a cursory read of the report, this is strange to me, because we build on Linux in CI all the time... |
|
The build issue is not with pampa but with the q2r R package - when I try linking against the rust crates it creates the linking error with deno -> v8. |
|
Ah! Gotcha, I understand it now. I think this makes sense for us to do right now, but I can't really guarantee that we won't violate this in the future! I would like to figure out a way to be able to make that promise such that we can keep the commitment, but our focus isn't currently in making these libraries easy to link against for developers. |
|
Totally fine by me - I dont need any guarantees at all, this is all a toy for me to play with for the foreseeable future. Definitely something nice to have eventually once everything is stable and working. |
Context
I've been playing around with building an R wrapper around q2/pampa and I've run into an issue building it on linux. See https://github.com/rundel/q2r if interested.
Issue
Library consumers of pampa that use only the parser and writer cannot build on Linux.
pampa::unified_filteris unconditionally exposed fromlib.rsand importsquarto_system_runtime::SystemRuntime, which transitively pullsdeno_coreand thev8prebuilt static archive.default-features = falseonpampadoes not drop this —quarto-system-runtimeis a non-optional workspace dep.The Linux x86_64 v8 static was compiled with the local-exec TLS model, so linking it into a consumer's
cdylibfails. macOS escapes this because Mach-O TLS goes through a runtime descriptor lookup that's identical in executables and dylibs.Sketch of fix
Feature-gate
quarto-system-runtimeincrates/pampa/Cargo.toml(markoptional = true), add afiltersfeature that pulls it in, gatepub mod unified_filter;andpub mod citeproc_filter;incrates/pampa/src/lib.rsbehind that feature, and make the existingjson-filterandlua-filterfeatures depend onfilters. Default features stay as today, so binary and existing library consumers see no change. Parser-only consumers can then opt out withdefault-features = false.