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: pgcentralfoundation/pgrx
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.12.6
Choose a base ref
...
head repository: pgcentralfoundation/pgrx
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: develop
Choose a head ref

Commits on Oct 20, 2024

  1. Copy the full SHA
    aa23f56 View commit details

Commits on Oct 23, 2024

  1. Explicitly enable object Cargo features (#1926)

    cargo-pgrx only works if we enable a minimal set of Cargo features for
    for the object crate, that we implicitly enable despite having set
    object to be `default-features = false`!
    
    The Cargo feature resolver has unified our "std" feature for object with
    the requested object features of our other dependencies that also depend
    on the object crate. However, these dependencies do so conditionally,
    based on the platform that they are compiling on. This means that if
    other dependencies stop using the object crate, or with less features,
    our enabled Cargo features for object will no longer be the correct set
    to build our own binary!
    
    This also implies some platforms are simply unable to build cargo-pgrx.
    Even if we don't support these platforms explicitly, we have generally
    taken a "smoke 'em if you got 'em" approach for unsupported platforms.
    Thus, enable enough of object's Cargo features to prevent weird problems
    from surfacing in the future through unrelated dependency changes, and
    make the cargo-pgrx build effectively platform-invariant.
    
    Whether it actually works on those platforms is a "them" problem, but
    now they should be able to actually get to debugging it a bit.
    workingjubilee authored Oct 23, 2024
    Copy the full SHA
    6a93f88 View commit details
  2. add commands/progress.h (#1924)

    https://github.com/postgres/postgres/blob/master/src/include/commands/progress.h
    It contains constants used with the progress reporting facilities.
    usamoi authored Oct 23, 2024
    Copy the full SHA
    80338f3 View commit details

Commits on Oct 24, 2024

  1. Imply NOT_IN_SAMPLE for GucFlags::NO_SHOW_ALL (#1925)

    Hi all, 
    
    firstly, thanks for giving pgrx to the world!
    
    We use pgrx at Lantern[^0] and when configuring GUCs noticed a small
    issue with GUC flags. Postgres requires `GUC_NOT_IN_SAMPLE` GUC flag to
    be set whenever `NO_SHOW_ALL` is set[^1]. Make applying
    `GucFlags::NO_SHOW_ALL` also apply `NOT_IN_SAMPLE`, as `NOT_IN_SAMPLE`
    cannot be set.
    
    After applying this diff, we no longer have a direct name matching
    between pgrx GUC names and postgres ones. An alternative might be to
    deprecate `NO_SHOW_ALL` and introduce something like
    `NO_SHOW_ALL_AND_NO_SAMPLE`, but not sure if it is worth it.
    
    [^0]: https://github.com/lanterndata/lantern
    [^1]: https://github.com/postgres/postgres/blob/dbedc461b4e7a9cb4d6f5777174bdf180edb95fd/src/backend/utils/misc/guc.c#L1506-L1519
    Ngalstyan4 authored Oct 24, 2024
    Copy the full SHA
    0193fd0 View commit details

Commits on Oct 27, 2024

  1. fix: crash from drop impls that panic via leak_and_drop_on_delete() (

    …#1929)
    
    If `PgMemoryContexts::leak_and_drop_on_delete()` leaks a type that is
    `impl Drop`, and that implementation happens to panic, then Postgres
    will segfault because the callback function was not properly guarded.
    
    As a drive-by, slightly cleanup error reporting in the test framework.
    eeeebbbbrrrr authored Oct 27, 2024
    Copy the full SHA
    e82264c View commit details
  2. Teach #[pg_cast] how to pass down arguments useful to #[pg_extern] (

    #1930)
    
    The `#[pg_cast]` macro does two things. It creates a regular UDF and it then generates the appropriate `CREATE CAST` sql.
    
    Ultimately, the cast is just a function so we should support all the attibutes that `#[pg_extern]` supports.
    eeeebbbbrrrr authored Oct 27, 2024
    Copy the full SHA
    a1e45c7 View commit details
  3. Copy the full SHA
    5a4ff45 View commit details
  4. Copy the full SHA
    77c6961 View commit details
  5. use allowlist_file for bindgen (#1922)

    Some platform definitions make bindgen unhappy (#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 (#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() (#1935)

    I can't quite explain why, but this function was deadlocking with this
    backtrace:
    
    ```
    * thread #1, name = 'cargo-pgrx', stop reason = signal SIGSTOP
      * frame #0: 0x00007fbe1eeb288d libc.so.6`syscall at syscall.S:38
        frame #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 #2: 0x000055aee526c590 cargo-pgrx`std::sys::sync::mutex::futex::Mutex::lock_contended::h6389e2305b0b005c at futex.rs:57:13
        frame #3: 0x000055aee4157835 cargo-pgrx`std::sync::mutex::Mutex$LT$T$GT$::lock::h4d2bb65800cc6fd3 at futex.rs:29:13
        frame #4: 0x000055aee41577ed cargo-pgrx`std::sync::mutex::Mutex$LT$T$GT$::lock::h4d2bb65800cc6fd3(self=0x000055aee6926c20) at mutex.rs:317:24
        frame #5: 0x000055aee406c779 cargo-pgrx`cargo_pgrx::command::install::get_git_hash::ha84d504db9d1bba8(manifest_path=0x00007ffdc43b83b0) at install.rs:507:9
        frame #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 (#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 (#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 (#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 (#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 (#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` (#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 #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 (#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 #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 (#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 (#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 (#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 28, 2024

  1. Copy the full SHA
    e169887 View commit details
  2. docs: fix pgx info in cargo-pgrx README (#1953)

    Hi there. I'm not sure if `pgx` is an old style name? Just fix it to
    `pgrx`.
    mrdrivingduck authored Dec 28, 2024
    Copy the full SHA
    c944bde View commit details
Showing with 1,546 additions and 4,419 deletions.
  1. +1 −1 .github/FUNDING.yml
  2. +60 −1 .github/workflows/package-test.yaml
  3. +60 −2 .github/workflows/runas.yml
  4. +8 −8 Cargo.lock
  5. +5 −5 Cargo.toml
  6. +6 −3 README.md
  7. +13 −6 cargo-pgrx/Cargo.toml
  8. +2 −2 cargo-pgrx/README.md
  9. +1 −1 cargo-pgrx/src/command/cross/pgrx_target.rs
  10. +1 −1 cargo-pgrx/src/command/init.rs
  11. +4 −3 cargo-pgrx/src/command/install.rs
  12. +11 −12 cargo-pgrx/src/command/schema.rs
  13. +1 −1 cargo-pgrx/src/command/test.rs
  14. +2 −2 cargo-pgrx/src/templates/cargo_toml
  15. +1 −1 pgrx-bindgen/Cargo.toml
  16. +63 −68 pgrx-bindgen/src/build.rs
  17. +0 −3,871 pgrx-bindgen/src/build/sym_blocklist.rs
  18. +1 −1 pgrx-examples/bgworker/src/lib.rs
  19. +1 −1 pgrx-examples/custom_sql/src/lib.rs
  20. +2 −2 pgrx-examples/schemas/src/lib.rs
  21. +6 −13 pgrx-examples/spi/src/lib.rs
  22. +3 −3 pgrx-examples/spi_srf/src/lib.rs
  23. +1 −1 pgrx-macros/Cargo.toml
  24. +29 −18 pgrx-macros/src/lib.rs
  25. +1 −1 pgrx-pg-config/Cargo.toml
  26. +11 −6 pgrx-pg-config/src/lib.rs
  27. +1 −1 pgrx-pg-sys/Cargo.toml
  28. +8 −0 pgrx-pg-sys/include/pg12.h
  29. +8 −0 pgrx-pg-sys/include/pg13.h
  30. +4 −0 pgrx-pg-sys/include/pg14.h
  31. +4 −0 pgrx-pg-sys/include/pg15.h
  32. +4 −0 pgrx-pg-sys/include/pg16.h
  33. +4 −0 pgrx-pg-sys/include/pg17.h
  34. +71 −0 pgrx-pg-sys/src/include/pg12.rs
  35. +4 −0 pgrx-pg-sys/src/include/pg12_oids.rs
  36. +94 −0 pgrx-pg-sys/src/include/pg13.rs
  37. +4 −0 pgrx-pg-sys/src/include/pg13_oids.rs
  38. +106 −0 pgrx-pg-sys/src/include/pg14.rs
  39. +4 −0 pgrx-pg-sys/src/include/pg14_oids.rs
  40. +106 −0 pgrx-pg-sys/src/include/pg15.rs
  41. +4 −0 pgrx-pg-sys/src/include/pg15_oids.rs
  42. +110 −0 pgrx-pg-sys/src/include/pg16.rs
  43. +4 −0 pgrx-pg-sys/src/include/pg16_oids.rs
  44. +114 −0 pgrx-pg-sys/src/include/pg17.rs
  45. +4 −0 pgrx-pg-sys/src/include/pg17_oids.rs
  46. +2 −0 pgrx-pg-sys/src/port.rs
  47. +7 −0 pgrx-pg-sys/src/submodules/oids.rs
  48. +3 −3 pgrx-pg-sys/src/submodules/panic.rs
  49. +1 −1 pgrx-sql-entity-graph/Cargo.toml
  50. +12 −12 pgrx-sql-entity-graph/src/aggregate/entity.rs
  51. +10 −11 pgrx-sql-entity-graph/src/extension_sql/entity.rs
  52. +1 −1 pgrx-sql-entity-graph/src/extension_sql/mod.rs
  53. +1 −1 pgrx-sql-entity-graph/src/extern_args.rs
  54. +19 −1 pgrx-sql-entity-graph/src/pg_extern/cast.rs
  55. +10 −10 pgrx-sql-entity-graph/src/pg_extern/entity/mod.rs
  56. +4 −4 pgrx-sql-entity-graph/src/pgrx_sql.rs
  57. +1 −1 pgrx-sql-entity-graph/src/postgres_enum/entity.rs
  58. +2 −2 pgrx-tests/Cargo.toml
  59. +5 −1 pgrx-tests/src/framework.rs
  60. +6 −18 pgrx-tests/src/tests/aggregate_tests.rs
  61. +4 −5 pgrx-tests/src/tests/anyelement_tests.rs
  62. +3 −5 pgrx-tests/src/tests/anynumeric_tests.rs
  63. +2 −5 pgrx-tests/src/tests/array_tests.rs
  64. +4 −15 pgrx-tests/src/tests/bgworker_tests.rs
  65. +2 −2 pgrx-tests/src/tests/borrow_datum.rs
  66. +54 −0 pgrx-tests/src/tests/guc_tests.rs
  67. +1 −1 pgrx-tests/src/tests/heap_tuple.rs
  68. +2 −8 pgrx-tests/src/tests/json_tests.rs
  69. +44 −0 pgrx-tests/src/tests/memcxt_tests.rs
  70. +29 −3 pgrx-tests/src/tests/pg_cast_tests.rs
  71. +1 −2 pgrx-tests/src/tests/proptests.rs
  72. +2 −2 pgrx-tests/src/tests/roundtrip_tests.rs
  73. +66 −94 pgrx-tests/src/tests/spi_tests.rs
  74. +10 −11 pgrx-tests/src/tests/srf_tests.rs
  75. +3 −3 pgrx-tests/src/tests/struct_type_tests.rs
  76. +2 −2 pgrx-tests/tests/compile-fail/escaping-spiclient-1209-cursor.rs
  77. +7 −7 pgrx-tests/tests/compile-fail/escaping-spiclient-1209-cursor.stderr
  78. +2 −2 pgrx-tests/tests/compile-fail/escaping-spiclient-1209-prep-stmt.rs
  79. +2 −2 pgrx-tests/tests/compile-fail/escaping-spiclient-1209-prep-stmt.stderr
  80. +8 −4 pgrx-tests/tests/compile-fail/invalid_pgcast_options.stderr
  81. +12 −0 pgrx-tests/tests/compile-fail/table-iterators-arent-immortal.stderr
  82. +8 −0 pgrx-tests/tests/compile-fail/too_many_cast_options.rs
  83. +7 −0 pgrx-tests/tests/compile-fail/too_many_cast_options.stderr
  84. +2 −2 pgrx-tests/tests/todo/roundtrip-tests.rs
  85. +9 −9 pgrx-tests/tests/todo/roundtrip-tests.stderr
  86. +1 −1 pgrx/Cargo.toml
  87. +4 −2 pgrx/src/bgworkers.rs
  88. +1 −0 pgrx/src/callbacks.rs
  89. +71 −0 pgrx/src/datum/mod.rs
  90. +10 −0 pgrx/src/datum/unbox.rs
  91. +2 −2 pgrx/src/guc.rs
  92. +1 −0 pgrx/src/hooks.rs
  93. +11 −6 pgrx/src/lib.rs
  94. +2 −0 pgrx/src/memcxt.rs
  95. +8 −5 pgrx/src/prelude.rs
  96. +19 −24 pgrx/src/spi.rs
  97. +18 −13 pgrx/src/spi/client.rs
  98. +2 −2 pgrx/src/spi/cursor.rs
  99. +58 −68 pgrx/src/spi/query.rs
  100. +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
16 changes: 8 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -55,11 +55,11 @@ exclude = [
cargo-pgrx = { path = "cargo-pgrx" }

[workspace.dependencies]
pgrx-macros = { path = "./pgrx-macros", version = "=0.12.6" }
pgrx-pg-sys = { path = "./pgrx-pg-sys", version = "=0.12.6" }
pgrx-sql-entity-graph = { path = "./pgrx-sql-entity-graph", version = "=0.12.6" }
pgrx-pg-config = { path = "./pgrx-pg-config", version = "=0.12.6" }
pgrx-bindgen = { path = "./pgrx-bindgen", version = "0.12.6" }
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" }

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.

19 changes: 13 additions & 6 deletions cargo-pgrx/Cargo.toml
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@

[package]
name = "cargo-pgrx"
version = "0.12.6"
version = "0.12.7"
authors = ["PgCentral Foundation, Inc. <contact@pgcentral.org>"]
license = "MIT"
description = "Cargo subcommand for 'pgrx' to make Postgres extension development easy"
@@ -41,11 +41,6 @@ jobslot = "0.2.12" # as seen in gmake -j{N}
semver = "1.0.20" # checking pgrx versions match
tempfile = "3.8.0"

# SQL schema generation
object = { version = "0.32.1", default-features = false, features = [ "std" ] }
proc-macro2.workspace = true
quote.workspace = true

# emit better diagnostics
color-eyre = "0.6.2"
eyre.workspace = true
@@ -63,6 +58,18 @@ tar = "0.4.40"
ureq = { version = "2.8.0", default-features = false, features = [ "gzip" ] }
url.workspace = true

# SQL schema generation
proc-macro2.workspace = true
quote.workspace = true
[dependencies.object]
version = "0.32.2"
default-features = false
features = [
"read_core", "std", # we use object read-only and like having actual errors
"coff", "elf", "macho", "pe", "xcoff", # support all object formats to allow cross-builds
]


[features]
default = ["rustls"]
native-tls = ["ureq/native-tls"]
4 changes: 2 additions & 2 deletions cargo-pgrx/README.md
Original file line number Diff line number Diff line change
@@ -644,7 +644,7 @@ that generate extension artifacts will automatically copy these files, and only
to their final destination as dictated by `pg_config`.


## Information about pgx-managed development environment
## Information about pgrx-managed development environment

```console
$ cargo pgrx info --help
@@ -664,7 +664,7 @@ Options:
-V, --version Print version
```

`cargo pgx info` helps retrieving information about pgx-managed development
`cargo pgrx info` helps retrieving information about pgrx-managed development
environment (such as managed Postgres installations)

## EXPERIMENTAL: Versioned shared-object support
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)
}
Loading