(id: &str)
| 6524 | } |
| 6525 | |
| 6526 | fn replacement_for_upstream_item(id: &str) -> Result<Option<&'static str>> { |
| 6527 | match id { |
| 6528 | "stable-protocol-exports" => { |
| 6529 | ensure_file_contains_all( |
| 6530 | WASIX_PATCH_PATH, |
| 6531 | &[ |
| 6532 | "src/backend/tcop/postgres.c", |
| 6533 | "PGLITE_HOST_EXPORT(\"pgl_startPGlite\")", |
| 6534 | "PGLITE_HOST_EXPORT(\"PostgresMainLongJmp\")", |
| 6535 | "__attribute__((export_name(\"ProcessStartupPacket\"))) int", |
| 6536 | ], |
| 6537 | )?; |
| 6538 | let patch_text = fs::read_to_string(WASIX_PATCH_PATH) |
| 6539 | .with_context(|| format!("read {WASIX_PATCH_PATH}"))?; |
| 6540 | if patch_adds_marker(&patch_text, "ProcessStartupPacket: STUB") { |
| 6541 | bail!("WASIX patch must not add a stub ProcessStartupPacket"); |
| 6542 | } |
| 6543 | ensure_file_contains_all( |
| 6544 | "src/pglite/postgres_mod.rs", |
| 6545 | &["PgliteLifecycleExports", "WasixProtocolExports"], |
| 6546 | )?; |
| 6547 | ensure_file_not_contains_any( |
| 6548 | "src/pglite/postgres_mod.rs", |
| 6549 | &[ |
| 6550 | "apply_direct_startup_gucs", |
| 6551 | "pgl_apply_default_gucs", |
| 6552 | "PostgresRecoverProtocolError", |
| 6553 | ], |
| 6554 | )?; |
| 6555 | ensure_file_contains_all( |
| 6556 | "tests/client_compat.rs", |
| 6557 | &[ |
| 6558 | "sqlx_extended_query_errors_recover_after_sync", |
| 6559 | "raw_wire_protocol_bind_errors_are_synchronized", |
| 6560 | "postgres_control_packets_are_handled_safely", |
| 6561 | ], |
| 6562 | )?; |
| 6563 | Ok(Some("WASIX protocol ABI + client/raw-wire tests")) |
| 6564 | } |
| 6565 | "stable-checkpointer-disable" => { |
| 6566 | ensure_file_contains_all( |
| 6567 | WASIX_PATCH_PATH, |
| 6568 | &[ |
| 6569 | "RequestCheckpoint(CHECKPOINT_CAUSE_XLOG)", |
| 6570 | "#ifndef __PGLITE__", |
| 6571 | "#endif", |
| 6572 | ], |
| 6573 | )?; |
| 6574 | ensure_file_contains_all( |
| 6575 | "tests/runtime_smoke.rs", |
| 6576 | &["persistent_fresh_initdb_survives_restart_and_stale_state_files"], |
| 6577 | )?; |
| 6578 | Ok(Some("ported into wasix-dl patch")) |
| 6579 | } |
| 6580 | "stable-external-checkpointer" => { |
| 6581 | ensure_file_contains_all( |
| 6582 | WASIX_PATCH_PATH, |
| 6583 | &[ |
no test coverage detected