MCPcopy Create free account
hub / github.com/f0rr0/oliphaunt / validate_sources_manifest

Function validate_sources_manifest

xtask/src/main.rs:5230–5334  ·  view source on GitHub ↗
(manifest: &SourcesManifest)

Source from the content-addressed store, hash-verified

5228}
5229
5230fn validate_sources_manifest(manifest: &SourcesManifest) -> Result<()> {
5231 if manifest.sources.is_empty() {
5232 bail!("assets/sources.toml must contain at least one source pin");
5233 }
5234 ensure_eq(
5235 &manifest.toolchain.wasmer,
5236 "7.2.0-alpha.3",
5237 "toolchain.wasmer",
5238 )?;
5239 ensure_eq(
5240 &manifest.toolchain.wasmer_wasix,
5241 "0.702.0-alpha.3",
5242 "toolchain.wasmer-wasix",
5243 )?;
5244 if !manifest
5245 .toolchain
5246 .docker_image_digest
5247 .strip_prefix("sha256:")
5248 .is_some_and(|digest| digest.len() == 64 && digest.chars().all(|ch| ch.is_ascii_hexdigit()))
5249 {
5250 bail!(
5251 "toolchain.docker_image_digest must pin a concrete sha256 digest, got {}",
5252 manifest.toolchain.docker_image_digest
5253 );
5254 }
5255 let dockerfile = fs::read_to_string("assets/wasix-build/docker/Dockerfile")
5256 .context("read WASIX build Dockerfile")?;
5257 if !dockerfile.contains(&format!(
5258 "FROM ubuntu:24.04@{}",
5259 manifest.toolchain.docker_image_digest
5260 )) {
5261 bail!("WASIX build Dockerfile must pin the same base image digest as assets/sources.toml");
5262 }
5263 ensure_eq(
5264 &manifest.build.postgres_prefix,
5265 "/",
5266 "build.postgres_prefix",
5267 )?;
5268 ensure_eq(
5269 &manifest.build.postgres_pkglibdir,
5270 "/lib/postgresql",
5271 "build.postgres_pkglibdir",
5272 )?;
5273 ensure_eq(
5274 &manifest.build.postgres_sharedir,
5275 "/share/postgresql",
5276 "build.postgres_sharedir",
5277 )?;
5278 ensure_contains(
5279 &manifest.build.main_flags,
5280 "-fwasm-exceptions",
5281 "build.main_flags",
5282 )?;
5283 ensure_no_flag_contains(&manifest.build.main_flags, "asyncify", "build.main_flags")?;
5284 ensure_contains(
5285 &manifest.build.extension_flags,
5286 "-fwasm-exceptions",
5287 "build.extension_flags",

Callers 4

assetsFunction · 0.85
check_sources_manifestFunction · 0.85
verify_committed_assetsFunction · 0.85

Calls 5

ensure_eqFunction · 0.85
ensure_containsFunction · 0.85
ensure_no_flag_containsFunction · 0.85
source_by_nameFunction · 0.85
lenMethod · 0.80

Tested by

no test coverage detected