(manifest: &SourcesManifest)
| 5228 | } |
| 5229 | |
| 5230 | fn 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", |
no test coverage detected