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

Function check_source_spine

xtask/src/main.rs:6811–7159  ·  view source on GitHub ↗
(
    manifest: &SourcesManifest,
    strict_local: bool,
    check_patch_applies: bool,
)

Source from the content-addressed store, hash-verified

6809}
6810
6811fn check_source_spine(
6812 manifest: &SourcesManifest,
6813 strict_local: bool,
6814 check_patch_applies: bool,
6815) -> Result<()> {
6816 let postgres = source_by_name(manifest, POSTGRES_PGLITE_SOURCE)?;
6817 let pglite_build = source_by_name(manifest, PGLITE_BUILD_SOURCE)?;
6818 check_source_free_repo()?;
6819 check_all_manifest_source_checkouts(manifest, strict_local)?;
6820
6821 let patch = Path::new(WASIX_PATCH_PATH);
6822 if !patch.exists() {
6823 bail!("missing WASIX source patch at {}", patch.display());
6824 }
6825 let patch_text =
6826 fs::read_to_string(patch).with_context(|| format!("read {}", patch.display()))?;
6827 let required_patch_markers = [
6828 "src/template/wasix-dl",
6829 "src/makefiles/Makefile.wasix-dl",
6830 "src/include/port/wasix-dl.h",
6831 "src/include/port/wasix-dl/sys/ipc.h",
6832 "src/include/port/wasix-dl/sys/shm.h",
6833 "src/backend/tcop/postgres.c",
6834 "src/backend/tcop/backend_startup.c",
6835 "__attribute__((export_name(\"ProcessStartupPacket\"))) int",
6836 "PGLITE_HOST_EXPORT(\"pgl_startPGlite\")",
6837 "PGLITE_HOST_EXPORT(\"PostgresMainLongJmp\")",
6838 "PGL_BACKEND_TIMING_INIT_POSTGRES",
6839 "PGL_BACKEND_TIMING_SHARED_MEMORY",
6840 "PGL_BACKEND_TIMING_EXEC_SIMPLE_QUERY",
6841 "wasm_dl_extension_imports_dir",
6842 "PGLITE_WASIX_DL",
6843 ];
6844 let missing_patch_markers = required_patch_markers
6845 .iter()
6846 .copied()
6847 .filter(|marker| !patch_text.contains(marker))
6848 .collect::<Vec<_>>();
6849 if !missing_patch_markers.is_empty() {
6850 bail!(
6851 "WASIX patch {} is missing expected source-spine entries: {}",
6852 patch.display(),
6853 missing_patch_markers.join(", ")
6854 );
6855 }
6856 let banned_added_patch_markers = [
6857 "#pragma warning \"-------------------- TEST",
6858 "return stderr;",
6859 "popen[%s]",
6860 "pg_pclose(%s)",
6861 "ProcessStartupPacket: STUB",
6862 "select_default_timezone(%s): STUB",
6863 "emscripten_extension_imports_dir :=",
6864 "pglite-wasm/",
6865 ];
6866 let mut banned_patch_additions = Vec::new();
6867 for marker in banned_added_patch_markers {
6868 if patch_adds_marker(&patch_text, marker) {

Callers 4

assetsFunction · 0.85
check_sources_manifestFunction · 0.85
fetch_pinned_sourcesFunction · 0.85

Calls 15

source_by_nameFunction · 0.85
check_source_free_repoFunction · 0.85
patch_adds_markerFunction · 0.85
build_plan_pgxs_pathFunction · 0.85
build_plan_contrib_pathFunction · 0.85
command_outputFunction · 0.85
ensure_fileFunction · 0.85
iterMethod · 0.80

Tested by

no test coverage detected