feat(imaging): default to pure-Rust codecs
Some checks failed
CI / rust-skia (Rust only) (push) Successful in 2m51s
CI / required (push) Failing after 3m23s

This commit is contained in:
2026-08-13 11:24:38 +00:00
parent e16ad04dbd
commit 25fdffbd3b
25 changed files with 124 additions and 103 deletions

View File

@@ -40,8 +40,8 @@ def check_owned_rust() -> None:
def check_features() -> None:
imaging = load_toml(OWNED_CRATES[0] / "Cargo.toml")
if imaging["features"].get("default") != []:
raise SystemExit("imaging default features must stay empty")
if imaging["features"].get("default") != ["rust-j2k"]:
raise SystemExit("imaging defaults must select only pure-Rust JPEG 2000")
if imaging["features"].get("jpeg2000") != ["dep:libremetaverse-openjpeg"]:
raise SystemExit("JPEG 2000 must stay isolated behind its optional feature")
if imaging["features"].get("rust-j2k") != ["dep:j2k"]:
@@ -50,8 +50,8 @@ def check_features() -> None:
raise SystemExit("the OpenJPEG adapter dependency must stay optional")
skia = load_toml(OWNED_CRATES[1] / "Cargo.toml")
if skia["features"].get("default") != []:
raise SystemExit("Skia adapter default features must stay empty")
if skia["features"].get("default") != ["rust-skia"]:
raise SystemExit("raster adapter defaults must select only pure-Rust codecs")
if skia["features"].get("skia") != ["dep:skia-safe"]:
raise SystemExit("Skia must stay isolated behind its optional feature")
targets = skia.get("target", {}).values()

View File

@@ -911,7 +911,10 @@ fn validate_features(name: &str, actual: &BTreeMap<String, Vec<String>>) -> Resu
let expected = match name {
"libremetaverse" => BTreeMap::from([
("dds-bc67".to_owned(), vec!["dep:bcdec_rs".to_owned()]),
("default".to_owned(), vec!["dds-bc67".to_owned()]),
(
"default".to_owned(),
vec!["dds-bc67".to_owned(), "rust-j2k".to_owned()],
),
(
"jpeg2000".to_owned(),
vec!["libremetaverse-imaging/jpeg2000".to_owned()],
@@ -923,7 +926,7 @@ fn validate_features(name: &str, actual: &BTreeMap<String, Vec<String>>) -> Resu
("vorbis".to_owned(), vec!["dep:vorbis_rs".to_owned()]),
]),
"libremetaverse-imaging" => BTreeMap::from([
("default".to_owned(), Vec::new()),
("default".to_owned(), vec!["rust-j2k".to_owned()]),
(
"jpeg2000".to_owned(),
vec!["dep:libremetaverse-openjpeg".to_owned()],
@@ -931,7 +934,7 @@ fn validate_features(name: &str, actual: &BTreeMap<String, Vec<String>>) -> Resu
("rust-j2k".to_owned(), vec!["dep:j2k".to_owned()]),
]),
"libremetaverse-imaging-skia" => BTreeMap::from([
("default".to_owned(), Vec::new()),
("default".to_owned(), vec!["rust-skia".to_owned()]),
(
"rust-skia".to_owned(),
vec![
@@ -1242,7 +1245,7 @@ The exact mapping, exported-marker, feature, and normalized Rust declaration has
- .NET events become `subscribe_*` calls returning an owned `Subscription`; callbacks are `Send + Sync` and dispatch outside internal locks.\n\
- `IDisposable` becomes explicit idempotent shutdown plus `Drop`; cancellation remains a typed `Error::Cancelled`.\n\
- Closed C# enums retain fixed discriminants and are SemVer-breaking to extend; flags retain unknown bits, while public Rust error enums are `non_exhaustive`.\n\
- Optional native and pure-Rust backends remain feature-gated (`jpeg2000`, `rust-j2k`, `skia`, `rust-skia`, `vorbis`, `real-audio`); default and empty-default sets are part of the baseline.\n\
- Pure-Rust image backends are enabled by default (`rust-j2k`, `rust-skia`); native alternatives remain feature-gated (`jpeg2000`, `skia`, `vorbis`, `real-audio`), and empty-default sets remain part of the baseline.\n\
- Capability HTTP injection uses project-owned `HttpMessageHandler`, `CapsHttpLimits`, and `with_native_transport`; the internal `reqwest` client is not part of the public surface.\n\
- External C# signature types map to core/std, adopted cross-platform crates, or project-owned boundary types; no third-party crate path leaks through mapped signatures or public Rust declarations.\n\n\
## Compile consumers\n\n\

View File

@@ -422,7 +422,7 @@ fn audit_cargo_features(root: &Path) -> Result<()> {
if defaults.iter().any(|feature| {
matches!(
feature.as_str(),
Some("jpeg2000" | "vorbis" | "dep:vorbis_rs")
Some("jpeg2000" | "skia" | "vorbis" | "dep:vorbis_rs")
)
}) {
return Err(MatrixError::new(
@@ -450,6 +450,8 @@ fn audit_cargo_features(root: &Path) -> Result<()> {
let default_tree = String::from_utf8_lossy(&default_tree.stdout);
for forbidden in [
"libremetaverse-openjpeg ",
"skia-safe ",
"skia-bindings ",
"vorbis_rs ",
"ogg_next_sys ",
"aotuv_lancer_vorbis_sys ",