Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: tensorchord/pgrx
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.12.9
Choose a base ref
...
head repository: tensorchord/pgrx
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Oct 27, 2024

  1. Copy the full SHA
    77c6961 View commit details
  2. use allowlist_file for bindgen (pgcentralfoundation#1922)

    Some platform definitions make bindgen unhappy (pgcentralfoundation#1882,
    rust-lang/rust-bindgen#2803 when compiling for
    x86_64-windows-msvc, `serialization error at builtin definitions: Cannot
    serialize type kind Opaque` when compiling for x86_64-windows-gnu on my
    machine), and `allowlist_file` could ensure that it does not happen.
    usamoi authored Oct 27, 2024
    Copy the full SHA
    039c24f View commit details

Commits on Oct 28, 2024

  1. Copy the full SHA
    ae0335b View commit details

Commits on Oct 29, 2024

  1. add pg_config --libdir to linker search path (pgcentralfoundation#1932

    )
    
    On Windows, the linker needs `postgres.lib` to link against. So add
    `pg_config --libdir` to linker search path.
    usamoi authored Oct 29, 2024
    Copy the full SHA
    7969a47 View commit details

Commits on Nov 2, 2024

  1. fix a deadlock in cargo pgrx install during get_git_hash() (pgcen…

    …tralfoundation#1935)
    
    I can't quite explain why, but this function was deadlocking with this
    backtrace:
    
    ```
    * thread pgcentralfoundation#1, name = 'cargo-pgrx', stop reason = signal SIGSTOP
      * frame #0: 0x00007fbe1eeb288d libc.so.6`syscall at syscall.S:38
        frame pgcentralfoundation#1: 0x000055aee526c5d3 cargo-pgrx`std::sys::sync::mutex::futex::Mutex::lock_contended::h6389e2305b0b005c [inlined] std::sys::pal::unix::futex::futex_wait::h30abf43e2d55aa33 at futex.rs:67:21
        frame pgcentralfoundation#2: 0x000055aee526c590 cargo-pgrx`std::sys::sync::mutex::futex::Mutex::lock_contended::h6389e2305b0b005c at futex.rs:57:13
        frame pgcentralfoundation#3: 0x000055aee4157835 cargo-pgrx`std::sync::mutex::Mutex$LT$T$GT$::lock::h4d2bb65800cc6fd3 at futex.rs:29:13
        frame pgcentralfoundation#4: 0x000055aee41577ed cargo-pgrx`std::sync::mutex::Mutex$LT$T$GT$::lock::h4d2bb65800cc6fd3(self=0x000055aee6926c20) at mutex.rs:317:24
        frame pgcentralfoundation#5: 0x000055aee406c779 cargo-pgrx`cargo_pgrx::command::install::get_git_hash::ha84d504db9d1bba8(manifest_path=0x00007ffdc43b83b0) at install.rs:507:9
        frame pgcentralfoundation#6: 0x000055aee406d6e9 cargo-pgrx`cargo_pgrx::command::install::filter_contents::h8c710847129ba6be(manifest_path=0x00007ffdc43b8d10, input=String @ 0x00007ffdc43b8940) at install.rs:541:46
    ```
    eeeebbbbrrrr authored Nov 2, 2024
    Copy the full SHA
    7de7210 View commit details
  2. Copy the full SHA
    2409ce2 View commit details
  3. exit early on errors

    eeeebbbbrrrr committed Nov 2, 2024
    Copy the full SHA
    8048ab3 View commit details

Commits on Nov 9, 2024

  1. lock patch version of pgrx-bindgen (pgcentralfoundation#1939)

    The typo makes my extension using v0.12.7 pulling pgrx-bindgen v0.12.8.
    usamoi authored Nov 9, 2024
    Copy the full SHA
    7b68a18 View commit details

Commits on Nov 13, 2024

  1. Allow creating Oid from a u32 in a const context (pgcentralfoundation…

    …#1943)
    
    This adds a `const fn` to create an `Oid` from a `u32`.
    `Oid::from_u32_unchecked` is the only way to do that currently, but it's
    deprecated and its successor `From::from` is non-const.
    syvb authored Nov 13, 2024
    Copy the full SHA
    6c9a85f View commit details

Commits on Nov 15, 2024

  1. Copy the full SHA
    68c4970 View commit details

Commits on Nov 19, 2024

  1. Add utils/acl.h (pgcentralfoundation#1945)

    Add useful ACL management functions
    daamien authored Nov 19, 2024
    Copy the full SHA
    6129d66 View commit details

Commits on Nov 20, 2024

  1. fix warnings (pgcentralfoundation#1948)

    1. `unexpected_cfgs` warnings are emitted for extension crates by latest
    nightly rustc, and it's annoying (`pgrx_embed` in `pgrx_embed`, and
    `Pg_magic_func` if extension does not support all postgres major
    versions)
    2. `PanicInfo` warnings are emitted by latest stable rustc while using
    local pgrx as a patch
    3. `static_mut_refs` warnings are emitted by latest nightly rustc while
    using local pgrx as a patch
    usamoi authored Nov 20, 2024
    Copy the full SHA
    49227e7 View commit details
  2. Add catalog/catalog.h (pgcentralfoundation#1946)

    Useful functions for catalog naming conventions and other hard-wired
    knowledge
    daamien authored Nov 20, 2024
    Copy the full SHA
    1efdfee View commit details
  3. Check wakeup_flags from wait_latch function to exit on `WL_POSTMAST…

    …ER_DEATH` (pgcentralfoundation#1938)
    
    There are some cases when the `wait_latch` loop in background worker is
    not being interrupted after the postmaster was exited.
    
    It can be reproduced by running postgres directly using
    `/opt/homebrew/opt/postgresql@17/bin/postgres -D
    /opt/homebrew/var/postgresql@17` and after the background worker will be
    started you will need to send `SIGKILL` to the postmaster process. (the
    issue is not reproducible when managing postgres via `pg_ctl`, I have
    encountered this issue during local development as homebrew service runs
    postgres directly using `postgres` binary)
    
    Then you can see that the postgres will be exited, but background worker
    process will remain active.
    
    > Make sure the WL_POSTMASTER_DEATH flag is set when calling that
    function, and verify the return code for a prompt exit in the emergency
    case that postgres itself has terminated.
    
    (see pgcentralfoundation#1938 for an example)
    var77 authored Nov 20, 2024
    Copy the full SHA
    7ca80af View commit details
  4. Changed args of prepare methods to be slices (pgcentralfoundation#1933)

    Since there's an opportunity to break more things for `0.13` I decided
    to improve the `prepare` and `prepare_mut` methods as well. The
    motivation for that is the same as for pgcentralfoundation#1858, `&[]` requires no heap
    allocations on the heap if there's a fixed set of arguments.
    YohDeadfall authored Nov 20, 2024
    Copy the full SHA
    c1e5dd9 View commit details

Commits on Nov 21, 2024

  1. Updating readme.me (pgcentralfoundation#1949)

    Updating readme for financial donations as well as encouraging people to
    join the Discord server
    ChronicallyJD authored Nov 21, 2024
    Copy the full SHA
    f1da6d9 View commit details

Commits on Nov 22, 2024

  1. Introduce a blocklist of "yanked" Postgres versions (pgcentralfoundat…

    …ion#1950)
    
    Due to the out-of-band release set described here:
    https://www.postgresql.org/about/news/postgresql-172-166-1510-1415-1318-and-1222-released-2965/,
    we should refuse to compile on the prior point releases mentioned in
    this press release.
    eeeebbbbrrrr authored Nov 22, 2024
    Copy the full SHA
    a0ecc8f View commit details

Commits on Nov 25, 2024

  1. Added oids_of! macro (pgcentralfoundation#1879)

    That's an improvement for SPI making it less cumbersome. Just to feel
    the difference look at the tests. Who would really want to write
    something like `PgBuiltInOids::INT4OID.oid()` instead of just telling a
    Rust type?
    YohDeadfall authored Nov 25, 2024
    Copy the full SHA
    eda7549 View commit details

Commits on Dec 9, 2024

  1. Copy the full SHA
    1f1dda3 View commit details
  2. Copy the full SHA
    41516d7 View commit details
  3. ui test is broken too

    usamoi committed Dec 9, 2024
    Copy the full SHA
    56af59f View commit details

Commits on Dec 22, 2024

  1. use musl for linux build

    usamoi committed Dec 22, 2024
    Copy the full SHA
    4141830 View commit details
  2. add target in upload-release

    usamoi committed Dec 22, 2024
    Copy the full SHA
    d4bfc4b View commit details
  3. install musl in upload-release

    usamoi committed Dec 22, 2024
    Copy the full SHA
    5b80a47 View commit details

Commits on Feb 11, 2025

  1. Copy the full SHA
    5b87eca View commit details
Showing with 712 additions and 4,329 deletions.
  1. +1 −1 .github/FUNDING.yml
  2. +60 −1 .github/workflows/package-test.yaml
  3. +60 −2 .github/workflows/runas.yml
  4. +68 −0 .github/workflows/upload-release.yml
  5. +1 −1 Cargo.toml
  6. +6 −3 README.md
  7. +1 −1 cargo-pgrx/src/command/cross/pgrx_target.rs
  8. +1 −1 cargo-pgrx/src/command/init.rs
  9. +4 −3 cargo-pgrx/src/command/install.rs
  10. +4 −4 cargo-pgrx/src/command/schema.rs
  11. +1 −1 cargo-pgrx/src/command/test.rs
  12. +63 −68 pgrx-bindgen/src/build.rs
  13. +0 −3,871 pgrx-bindgen/src/build/sym_blocklist.rs
  14. +1 −1 pgrx-examples/bgworker/src/lib.rs
  15. +1 −1 pgrx-examples/custom_sql/src/lib.rs
  16. +2 −2 pgrx-examples/schemas/src/lib.rs
  17. +6 −13 pgrx-examples/spi/src/lib.rs
  18. +3 −3 pgrx-examples/spi_srf/src/lib.rs
  19. +11 −6 pgrx-pg-config/src/lib.rs
  20. +6 −0 pgrx-pg-sys/include/pg12.h
  21. +6 −0 pgrx-pg-sys/include/pg13.h
  22. +2 −0 pgrx-pg-sys/include/pg14.h
  23. +2 −0 pgrx-pg-sys/include/pg15.h
  24. +2 −0 pgrx-pg-sys/include/pg16.h
  25. +2 −0 pgrx-pg-sys/include/pg17.h
  26. +2 −0 pgrx-pg-sys/src/port.rs
  27. +7 −0 pgrx-pg-sys/src/submodules/oids.rs
  28. +3 −3 pgrx-pg-sys/src/submodules/panic.rs
  29. +6 −18 pgrx-tests/src/tests/aggregate_tests.rs
  30. +4 −5 pgrx-tests/src/tests/anyelement_tests.rs
  31. +3 −5 pgrx-tests/src/tests/anynumeric_tests.rs
  32. +2 −5 pgrx-tests/src/tests/array_tests.rs
  33. +4 −15 pgrx-tests/src/tests/bgworker_tests.rs
  34. +2 −2 pgrx-tests/src/tests/borrow_datum.rs
  35. +1 −1 pgrx-tests/src/tests/guc_tests.rs
  36. +1 −1 pgrx-tests/src/tests/heap_tuple.rs
  37. +2 −8 pgrx-tests/src/tests/json_tests.rs
  38. +2 −2 pgrx-tests/src/tests/pg_cast_tests.rs
  39. +1 −2 pgrx-tests/src/tests/proptests.rs
  40. +2 −2 pgrx-tests/src/tests/roundtrip_tests.rs
  41. +66 −94 pgrx-tests/src/tests/spi_tests.rs
  42. +10 −11 pgrx-tests/src/tests/srf_tests.rs
  43. +3 −3 pgrx-tests/src/tests/struct_type_tests.rs
  44. +2 −2 pgrx-tests/tests/compile-fail/escaping-spiclient-1209-cursor.rs
  45. +7 −7 pgrx-tests/tests/compile-fail/escaping-spiclient-1209-cursor.stderr
  46. +2 −2 pgrx-tests/tests/compile-fail/escaping-spiclient-1209-prep-stmt.rs
  47. +2 −2 pgrx-tests/tests/compile-fail/escaping-spiclient-1209-prep-stmt.stderr
  48. +1 −1 pgrx-tests/tests/compile-fail/table-iterators-arent-immortal.rs
  49. +3 −3 pgrx-tests/tests/compile-fail/table-iterators-arent-immortal.stderr
  50. +2 −2 pgrx-tests/tests/todo/roundtrip-tests.rs
  51. +9 −9 pgrx-tests/tests/todo/roundtrip-tests.stderr
  52. +4 −2 pgrx/src/bgworkers.rs
  53. +1 −0 pgrx/src/callbacks.rs
  54. +71 −0 pgrx/src/datum/mod.rs
  55. +40 −10 pgrx/src/datum/unbox.rs
  56. +1 −0 pgrx/src/hooks.rs
  57. +11 −6 pgrx/src/lib.rs
  58. +8 −5 pgrx/src/prelude.rs
  59. +19 −24 pgrx/src/spi.rs
  60. +18 −13 pgrx/src/spi/client.rs
  61. +2 −2 pgrx/src/spi/cursor.rs
  62. +58 −68 pgrx/src/spi/query.rs
  63. +16 −11 prepare-release.sh
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# These are supported funding model platforms

github: [eeeebbbbrrrr] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
github: [eeeebbbbrrrr, workingjubilee] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
# patreon: # Replace with a single Patreon username
# open_collective: # Replace with a single Open Collective username
# ko_fi: # Replace with a single Ko-fi username
61 changes: 60 additions & 1 deletion .github/workflows/package-test.yaml
Original file line number Diff line number Diff line change
@@ -22,14 +22,73 @@ jobs:
with:
prefix-key: "v1-pgrx--package-test"

- name: Set up prerequisites and environment
run: |
sudo apt-get update -y -qq --fix-missing
echo ""
echo "----- Install sccache -----"
mkdir -p $HOME/.local/bin
curl -L https://github.com/mozilla/sccache/releases/download/v0.2.15/sccache-v0.2.15-x86_64-unknown-linux-musl.tar.gz | tar xz
mv -f sccache-v0.2.15-x86_64-unknown-linux-musl/sccache $HOME/.local/bin/sccache
chmod +x $HOME/.local/bin/sccache
echo "$HOME/.local/bin" >> $GITHUB_PATH
mkdir -p /home/runner/.cache/sccache
echo ""
echo "----- Set up dynamic variables -----"
cat $GITHUB_ENV
echo ""
echo "----- Remove old postgres -----"
sudo apt remove -y '^postgres.*' '^libpq.*' '^clang.*' '^llvm.*' '^libclang.*' '^libllvm.*' '^mono-llvm.*'
echo ""
echo "----- Install system dependencies -----"
sudo apt-get install -y \
build-essential \
llvm-14-dev libclang-14-dev clang-14 \
gcc \
libssl-dev \
libz-dev \
make \
pkg-config \
strace \
zlib1g-dev
echo ""
"$TOOL_DIR"/rustup.sh
echo "----- Set up cross compilation -----"
sudo apt-get install -y --fix-missing crossbuild-essential-arm64
echo 'CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc' >> $GITHUB_ENV
# TODO: not all of these should be needed, but for now it's likely fine.
echo 'BINDGEN_EXTRA_CLANG_ARGS_aarch64-unknown-linux-gnu=-target aarch64-unknown-linux-gnu -isystem /usr/aarch64-linux-gnu/include/ -ccc-gcc-name aarch64-linux-gnu-gcc' >> $GITHUB_ENV
echo "----- Print env -----"
env
echo ""
- name: Setup release Postgres apt repo
run: |
sudo apt-get install -y wget gnupg
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
- name: Install Postgres deps
run: |
sudo apt-get update -y -qq --fix-missing
sudo apt-get install -y postgresql-server-dev-$PG_VER
sudo apt-get install -y postgresql-$PG_VER postgresql-server-dev-$PG_VER
- name: Rustup
run: $TOOL_DIR/rustup.sh nightly

- name: Report version
run: |
cargo --version
pg_config --version
- name: Install cargo pgrx
run: cargo +nightly install --path cargo-pgrx --debug

62 changes: 60 additions & 2 deletions .github/workflows/runas.yml
Original file line number Diff line number Diff line change
@@ -9,6 +9,8 @@ on:
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
TOOL_DIR: ./tools
PG_VER: 14

jobs:
ubuntu:
@@ -20,13 +22,69 @@ jobs:
with:
prefix-key: "v1-cargo-pgrx-test--runas"

- name: Set up prerequisites and environment
run: |
sudo apt-get update -y -qq --fix-missing
echo ""
echo "----- Install sccache -----"
mkdir -p $HOME/.local/bin
curl -L https://github.com/mozilla/sccache/releases/download/v0.2.15/sccache-v0.2.15-x86_64-unknown-linux-musl.tar.gz | tar xz
mv -f sccache-v0.2.15-x86_64-unknown-linux-musl/sccache $HOME/.local/bin/sccache
chmod +x $HOME/.local/bin/sccache
echo "$HOME/.local/bin" >> $GITHUB_PATH
mkdir -p /home/runner/.cache/sccache
echo ""
echo "----- Set up dynamic variables -----"
cat $GITHUB_ENV
echo ""
echo "----- Remove old postgres -----"
sudo apt remove -y '^postgres.*' '^libpq.*' '^clang.*' '^llvm.*' '^libclang.*' '^libllvm.*' '^mono-llvm.*'
echo ""
echo "----- Install system dependencies -----"
sudo apt-get install -y \
build-essential \
llvm-14-dev libclang-14-dev clang-14 \
gcc \
libssl-dev \
libz-dev \
make \
pkg-config \
strace \
zlib1g-dev
echo ""
"$TOOL_DIR"/rustup.sh
echo "----- Set up cross compilation -----"
sudo apt-get install -y --fix-missing crossbuild-essential-arm64
echo 'CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc' >> $GITHUB_ENV
# TODO: not all of these should be needed, but for now it's likely fine.
echo 'BINDGEN_EXTRA_CLANG_ARGS_aarch64-unknown-linux-gnu=-target aarch64-unknown-linux-gnu -isystem /usr/aarch64-linux-gnu/include/ -ccc-gcc-name aarch64-linux-gnu-gcc' >> $GITHUB_ENV
echo "----- Print env -----"
env
echo ""
- name: Setup release Postgres apt repo
run: |
sudo apt-get install -y wget gnupg
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
- name: Install Postgres deps
run: |
sudo apt-get update -y -qq --fix-missing
sudo apt-get install -y postgresql-server-dev-14
sudo apt-get install -y postgresql-$PG_VER postgresql-server-dev-$PG_VER
- name: Report version
run: cargo --version
run: |
cargo --version
pg_config --version
- name: Install cargo pgrx
run: cd cargo-pgrx && cargo install --path . --debug
68 changes: 68 additions & 0 deletions .github/workflows/upload-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: upload release

on:
workflow_dispatch:
inputs:
tag:
type: string
description: Tag
required: true

permissions:
contents: write

jobs:
upload-release:
name: upload-release
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
target: x86_64-unknown-linux-musl
pkg_fmt: .tar.gz
binary_ext: ""
- os: ubuntu-22.04-arm
target: aarch64-unknown-linux-musl
pkg_fmt: .tar.gz
binary_ext: ""
- os: macos-13
target: x86_64-apple-darwin
pkg_fmt: .tar.gz
binary_ext: ""
- os: macos-14
target: aarch64-apple-darwin
pkg_fmt: .tar.gz
binary_ext: ""
- os: windows-2022
target: x86_64-pc-windows-msvc
pkg_fmt: .zip
binary_ext: .exe
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.tag }}
- name: Upload cargo-pgrx
env:
GH_TOKEN: ${{ github.token }}
shell: bash
run: |
if [ "${{ matrix.os }}" = "ubuntu-22.04" ] || [ "${{ matrix.os }}" = "ubuntu-22.04-arm" ]; then
sudo apt install musl-tools
rustup target add ${{ matrix.target }}
fi
cargo build -p cargo-pgrx --bin cargo-pgrx --features cargo-edit/vendored-openssl --target ${{ matrix.target }} --release
mkdir -p build
cp README.md ./build/
cp LICENSE ./build/
cp ./target/${{ matrix.target }}/release/cargo-pgrx${{ matrix.binary_ext }} ./build/
DIST=cargo-pgrx-${{ github.event.inputs.tag }}-${{ matrix.target }}${{ matrix.pkg_fmt }}
if [ "${{ matrix.os }}" = "windows-2022" ]; then
(cd build && 7z a ../$DIST .)
else
tar czf $DIST -C build .
fi
gh release upload ${{ github.event.inputs.tag }} $DIST
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -59,7 +59,7 @@ pgrx-macros = { path = "./pgrx-macros", version = "=0.12.7" }
pgrx-pg-sys = { path = "./pgrx-pg-sys", version = "=0.12.7" }
pgrx-sql-entity-graph = { path = "./pgrx-sql-entity-graph", version = "=0.12.7" }
pgrx-pg-config = { path = "./pgrx-pg-config", version = "=0.12.7" }
pgrx-bindgen = { path = "./pgrx-bindgen", version = "0.12.7" }
pgrx-bindgen = { path = "./pgrx-bindgen", version = "=0.12.7" }

cargo_metadata = "0.18.0"
cargo-edit = "0.12.2" # format-preserving edits to cargo.toml
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -15,7 +15,11 @@

`pgrx` supports Postgres 12 through Postgres 17.

**Feel free to join our [Discord Server](https://discord.gg/PMrpdJsqcJ).**
## Want to chat with us or get a question answered?

+ **Please join our [Discord Server](https://discord.gg/PMrpdJsqcJ).**

+ **We are also in need of financial [sponsorship](https://checkout.square.site/merchant/MLHG5M9GAXQPV/checkout/2OW2SULDQBSZ2JLHSLRZQLZH).**

## Key Features

@@ -312,8 +316,7 @@ error[E0080]: evaluation of constant value failed

## Contributing

We are most definitely open to contributions of any kind. Bug Reports, Feature Requests, Documentation,
and even [sponsorships](https://github.com/sponsors/eeeebbbbrrrr).
We are most definitely open to contributions of any kind. Bug Reports, Feature Requests, and Documentation.

If you'd like to contribute code via a Pull Request, please make it against our `develop` branch. The `master` branch is no longer used.

2 changes: 1 addition & 1 deletion cargo-pgrx/src/command/cross/pgrx_target.rs
Original file line number Diff line number Diff line change
@@ -112,7 +112,7 @@ fn make_target_info(cmd: &PgrxTarget, tmp: &Path) -> Result<()> {
.arg("--features")
.arg(format!("pgrx-pg-sys/pg{major_version}"))
.env("PGRX_PG_CONFIG_PATH", &pg_config_path)
.env("PGRX_PG_SYS_EXTRA_OUTPUT_PATH", &tmp.join(&filename)))?;
.env("PGRX_PG_SYS_EXTRA_OUTPUT_PATH", tmp.join(&filename)))?;

run(Command::new("rustfmt").current_dir(tmp).arg(&filename))?;
run(Command::new("tar").current_dir(tmp).arg("czf").arg("out.tgz").arg(&filename))?;
2 changes: 1 addition & 1 deletion cargo-pgrx/src/command/init.rs
Original file line number Diff line number Diff line change
@@ -273,7 +273,7 @@ fn untar(bytes: &[u8], pgrxdir: &Path, pg_config: &PgConfig, init: &Init) -> eyr
let _token = init.jobserver.get().unwrap().acquire().unwrap();

let mut unpackdir = pgrxdir.to_path_buf();
unpackdir.push(&format!("{}_unpack", pg_config.version()?));
unpackdir.push(format!("{}_unpack", pg_config.version()?));
if unpackdir.exists() {
// delete everything at this path if it already exists
println!("{} {}", " Removing".bold().green(), unpackdir.display());
7 changes: 4 additions & 3 deletions cargo-pgrx/src/command/install.rs
Original file line number Diff line number Diff line change
@@ -131,7 +131,7 @@ pub(crate) fn install_extension(
let mut output_tracking = Vec::new();
let base_directory = base_directory.unwrap_or_else(|| PathBuf::from("/"));
tracing::Span::current()
.record("base_directory", &tracing::field::display(&base_directory.display()));
.record("base_directory", tracing::field::display(&base_directory.display()));

let manifest = Manifest::from_path(&package_manifest_path)?;
let (control_file, extname) = find_control_file(&package_manifest_path)?;
@@ -494,7 +494,8 @@ static GIT_HASH: OnceLock<MemoizeKeyValue> = OnceLock::new();
fn get_git_hash(manifest_path: impl AsRef<Path>) -> eyre::Result<String> {
let path_string = manifest_path.as_ref().to_owned();

if let Some(hash) = GIT_HASH.get_or_init(Default::default).lock().unwrap().get(&path_string) {
let mut mutex = GIT_HASH.get_or_init(Default::default).lock().unwrap();
if let Some(hash) = mutex.get(&path_string) {
Ok(hash.clone())
} else {
let hash = match get_property(manifest_path, "git_hash")? {
@@ -504,7 +505,7 @@ fn get_git_hash(manifest_path: impl AsRef<Path>) -> eyre::Result<String> {
)),
};

GIT_HASH.get_or_init(Default::default).lock().unwrap().insert(path_string, hash.clone());
mutex.insert(path_string, hash.clone());

Ok(hash)
}
8 changes: 4 additions & 4 deletions cargo-pgrx/src/command/schema.rs
Original file line number Diff line number Diff line change
@@ -343,7 +343,7 @@ fn first_build(

if !features_arg.trim().is_empty() {
command.arg("--features");
command.arg(&features_arg);
command.arg(features_arg);
}

if features.no_default_features {
@@ -387,7 +387,7 @@ fn compute_codegen(
dot: Option<String>,
) -> eyre::Result<String> {
use proc_macro2::{Ident, Span, TokenStream};
let lib_name_ident = Ident::new(&lib_name, Span::call_site());
let lib_name_ident = Ident::new(lib_name, Span::call_site());

let inputs = {
let control_file_path = control_file_path
@@ -458,7 +458,7 @@ fn compute_codegen(
out
};
Ok(quote::quote! {
fn main() {
pub fn main() {
#inputs
#build
#outputs
@@ -501,7 +501,7 @@ fn second_build(

if !features_arg.trim().is_empty() {
command.arg("--features");
command.arg(&features_arg);
command.arg(features_arg);
}

if features.no_default_features {
2 changes: 1 addition & 1 deletion cargo-pgrx/src/command/test.rs
Original file line number Diff line number Diff line change
@@ -127,7 +127,7 @@ pub fn test_extension(
pgdata: Option<PathBuf>,
) -> eyre::Result<()> {
if let Some(ref testname) = testname {
tracing::Span::current().record("testname", &tracing::field::display(&testname.as_ref()));
tracing::Span::current().record("testname", tracing::field::display(&testname.as_ref()));
}
let target_dir = get_target_dir()?;

Loading