-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented pipeline detection for PGXS and pgrx
The PGXS pipeline examines the `Makefile` (via regular expressions), while the pgrx pipeline examines `Cargo.toml` (via the cargo_toml crate). Each produces a score (0-255), and the highest score wins. If all pipeline candidates return 0 it returns an error. Now Build::new handles a pipeline name specified in the release metadata, while Build::detect figures out which to use when none is specified. Builder::new now takes a `sudo` param, to indicate whether `sudo` and passes it to Build::new and Build::detect. Other tweaks: * Added an `install` method to the Builder, the Pipeline trait, and placeholder implementations in the Pgrx and Pgxs implementations. * Removed the `download` and `unpack` methods from the Builder, Pipeline trait, and implementations, as the api::Api struct handles this functionality.
- Loading branch information
Showing
9 changed files
with
296 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,29 @@ | ||
//! Build Pipeline interface definition. | ||
use crate::error::BuildError; | ||
use std::path::PathBuf; | ||
use std::path::{Path, PathBuf}; | ||
|
||
/// Defines the interface for build pipelines to configure, compile, and test | ||
/// PGXN distributions. | ||
pub(crate) trait Pipeline { | ||
/// Creates an instance of a Builder. | ||
/// Creates an instance of a Pipeline. | ||
fn new(dir: PathBuf, sudo: bool) -> Self; | ||
|
||
/// Returns a score for the confidence that this pipeline can build the | ||
/// contents of `dir`. A score of 0 means no confidence and 255 means the | ||
/// highest confidence. | ||
fn confidence(dir: &Path) -> u8; | ||
|
||
/// Configures a distribution to build on a particular platform and | ||
/// Postgres version. | ||
fn configure(&self) -> Result<(), BuildError>; | ||
|
||
/// Compiles a distribution on a particular platform and Postgres version. | ||
fn compile(&self) -> Result<(), BuildError>; | ||
|
||
/// Installs a distribution on a particular platform and Postgres version. | ||
fn install(&self) -> Result<(), BuildError>; | ||
|
||
/// Tests a distribution a particular platform and Postgres version. | ||
fn test(&self) -> Result<(), BuildError>; | ||
} |
Oops, something went wrong.