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

Function extension_build_module_path

xtask/src/main.rs:7498–7526  ·  view source on GitHub ↗
(
    build_dir: &Path,
    extension: &extension_catalog::PromotedExtensionBuildSpec,
)

Source from the content-addressed store, hash-verified

7496}
7497
7498fn extension_build_module_path(
7499 build_dir: &Path,
7500 extension: &extension_catalog::PromotedExtensionBuildSpec,
7501) -> Result<PathBuf> {
7502 let module_file = extension
7503 .module_file
7504 .as_deref()
7505 .ok_or_else(|| anyhow!("extension {} has no native module", extension.sql_name))?;
7506 match extension.build_kind.as_str() {
7507 "postgres-contrib" => {
7508 let contrib_dir = extension
7509 .contrib_dir
7510 .as_deref()
7511 .ok_or_else(|| anyhow!("contrib extension {} has no contrib_dir", extension.id))?;
7512 Ok(build_dir
7513 .join("contrib")
7514 .join(contrib_dir)
7515 .join(module_file))
7516 }
7517 "pgxs-external" => Ok(pgxs_extension_build_dir(build_dir, extension).join(module_file)),
7518 "postgis" => Ok(Path::new(POSTGRES_OTHER_EXTENSIONS)
7519 .join(&extension.id)
7520 .join(module_file)),
7521 other => bail!(
7522 "promoted extension {} has unsupported build kind {other}",
7523 extension.sql_name
7524 ),
7525 }
7526}
7527
7528fn pgxs_extension_build_dir(
7529 build_dir: &Path,

Callers 1

discoverMethod · 0.85

Calls 2

pgxs_extension_build_dirFunction · 0.85
joinMethod · 0.45

Tested by

no test coverage detected