Complete first release candidate audit (#107)
Some checks failed
API and SemVer surface / api-surface (push) Failing after 1m34s
Native code generation / deterministic (push) Has been cancelled
Concurrency and resource soak audit / soak (push) Has been cancelled
Documentation / documentation (push) Has been cancelled
performance evidence / audit (push) Has been cancelled
First release candidate / non-fuzz-release-gate (push) Has been cancelled
Release platform and feature matrix / audit (push) Has been cancelled
Release platform and feature matrix / matrix (false, linux-stable-minimal, x86_64-unknown-linux-gnu, stable) (push) Has been cancelled
Release platform and feature matrix / matrix (false, macos-stable-portable, x86_64-apple-darwin, stable) (push) Has been cancelled
Release platform and feature matrix / matrix (false, windows-stable-portable, x86_64-pc-windows-gnu, stable) (push) Has been cancelled
Release platform and feature matrix / matrix (true, linux-msrv-portable, x86_64-unknown-linux-gnu, 1.96.0) (push) Has been cancelled
Release platform and feature matrix / matrix (true, linux-stable-default, x86_64-unknown-linux-gnu, stable) (push) Has been cancelled
Release platform and feature matrix / matrix (true, linux-stable-features, x86_64-unknown-linux-gnu, stable) (push) Has been cancelled
Release platform and feature matrix / matrix (true, linux-stable-release-surface, x86_64-unknown-linux-gnu, stable) (push) Has been cancelled
Dependency and supply-chain audit / audit (push) Has been cancelled
Native release artifact audit / audit (push) Has been cancelled
Imaging and meshing gate / native (push) Failing after 53s
JPEG 2000 feature / linux (push) Successful in 2m49s
Native Rust workspace compile / compile (push) Failing after 59s
Skia feature / linux (push) Has been cancelled

This commit is contained in:
2026-08-12 14:44:28 +00:00
parent dceb394378
commit c9a1170a27
140 changed files with 82175 additions and 27179 deletions

View File

@@ -0,0 +1,89 @@
//! Cross-platform renderer discovery without CLR assembly loading.
use std::path::Path;
use crate::Error;
use crate::rendering::IRendering;
const BUILTIN_SIMPLE: &str = "builtin:simple";
pub(crate) fn list_renderers(path: &str) -> Result<Vec<String>, Error> {
let directory = Path::new(path);
if !directory.is_dir() {
return Err(Error::Argument);
}
let mut renderers = vec![BUILTIN_SIMPLE.to_owned()];
let entries = std::fs::read_dir(directory).map_err(|_| Error::Argument)?;
for entry in entries {
let entry = entry.map_err(|_| Error::Argument)?;
let file_type = entry.file_type().map_err(|_| Error::Argument)?;
if !file_type.is_file() {
continue;
}
let name = entry.file_name();
let name = name.to_string_lossy().to_ascii_lowercase();
if is_simple_artifact(&name) {
renderers.push(entry.path().to_string_lossy().into_owned());
}
}
renderers.sort();
renderers.dedup();
Ok(renderers)
}
pub(crate) fn load_renderer(filename: &str) -> Result<Box<dyn IRendering>, Error> {
let normalized = Path::new(filename)
.file_name()
.and_then(|name| name.to_str())
.unwrap_or(filename)
.to_ascii_lowercase();
if filename.eq_ignore_ascii_case(BUILTIN_SIMPLE)
|| filename.eq_ignore_ascii_case("simple")
|| filename.eq_ignore_ascii_case("LibreMetaverse.Rendering.Simple")
|| is_simple_artifact(&normalized)
{
return Ok(Box::new(
crate::builtin_simple_renderer::SimpleRenderer::native_new()?,
));
}
Err(Error::Rendering {
source: libremetaverse_types::UUID::zero(),
context: "unknown or unsupported renderer",
})
}
fn is_simple_artifact(name: &str) -> bool {
name.contains("libremetaverse_rendering_simple")
|| name.contains("libremetaverse-rendering-simple")
|| name.contains("libremetaverse.rendering.simple")
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn built_in_renderer_is_discoverable_and_constructible() {
let renderers = list_renderers(env!("CARGO_MANIFEST_DIR")).unwrap();
assert!(renderers.iter().any(|name| name == BUILTIN_SIMPLE));
let renderer = load_renderer(BUILTIN_SIMPLE).unwrap();
let mut vertices = Vec::new();
renderer
.transform_tex_coords(
&mut vertices,
libremetaverse_types::Vector3::zero(),
crate::PrimitiveTextureEntryFace::new(None).unwrap(),
libremetaverse_types::Vector3::one(),
)
.unwrap();
}
#[test]
fn discovery_recognizes_platform_artifact_names() {
assert!(is_simple_artifact("liblibremetaverse_rendering_simple.so"));
assert!(is_simple_artifact("libremetaverse_rendering_simple.dll"));
assert!(is_simple_artifact(
"liblibremetaverse_rendering_simple.dylib"
));
}
}