Welcome to pgrx v0.11.4!
This is a minor release to add some additional functionality to cargo-pgrx
to enable running tests in atypical CI configurations and the ability to turn off its colored output via the NO_COLOR
environment variable. This minor release also includes a small change that should measurably improve compilation times for all extensions.
To update to this this, please run cargo install cargo-pgrx --version 0.11.4 --locked
and ensure to update your extension's Cargo.toml
file to use pgrx v0.11.4.
What Changed
cargo-pgrx
changes
PR #1652 was cherry-picked into this release to include the new --runas
and --pgdata
arguments to cargo pgrx test
. --runas
uses the system sudo
command to run the temporary Postgres cluster process as the specified user, and uses --pgdata
as the location where the cluster's PGDATA directory should be initialized.
cargo-pgrx
now understands the NO_COLOR
and FORCE_COLOR
environment variables supported by the upstream dependency it uses for generated colored output. See https://crates.io/crates/owo-colors for details. This is from PR #1664
Compilation Times
pgrx generates a (very large) set of Rust bindings that represent the "rust version" of all the internal Postgres symbols (functions, globals, etc). In the case of functions, pgrx also generates wrapper functions so it can instrument calls with the proper guard rails. It turns out, simply annotating these wrapper functions with #[inline]
drastically improves compilation time as it allows the rust compiler to defer their compilation until the very end. Which ultimately means only the functions used by an extension get compiled -- the others are DCE'd. This came from PR #1616.
Thanks!
Thanks to @usamoi for improving our compilation times, and shout out to @theory for his first contribution!
Full Changelog: v0.11.3...v0.11.4