Skip to content

Commit f7c766d

Browse files
authored
chore: update pgrx to 0.12.5 & add pg17 in check and release (#600)
* chore: update pgrx to 0.12.5 & add pg17 in check and release Signed-off-by: usamoi <[email protected]> * chore: update vendor * fix: set pgrx version Signed-off-by: usamoi <[email protected]> * fix: clippy Signed-off-by: usamoi <[email protected]> * fix: do not use mul_add Signed-off-by: usamoi <[email protected]> * fix: temporarily removes the test that fails on PostgreSQL 17 Signed-off-by: usamoi <[email protected]> --------- Signed-off-by: usamoi <[email protected]>
1 parent b3d3243 commit f7c766d

File tree

31 files changed

+129395
-1892
lines changed

31 files changed

+129395
-1892
lines changed

.github/workflows/psql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
test:
4949
strategy:
5050
matrix:
51-
version: [14, 15, 16]
51+
version: [14, 15, 16, 17]
5252
arch: ["x86_64"]
5353
runs-on: ubuntu-latest
5454
env:

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
binary:
4242
strategy:
4343
matrix:
44-
version: [14, 15, 16]
44+
version: [14, 15, 16, 17]
4545
arch: ["x86_64", "aarch64"]
4646
runs-on: ubuntu-20.04
4747
env:
@@ -109,7 +109,7 @@ jobs:
109109
needs: ["binary", "semver"]
110110
strategy:
111111
matrix:
112-
version: [14, 15, 16]
112+
version: [14, 15, 16, 17]
113113
platform: ["amd64", "arm64"]
114114
runs-on: ubuntu-latest
115115
steps:
@@ -142,7 +142,7 @@ jobs:
142142
runs-on: ubuntu-latest
143143
strategy:
144144
matrix:
145-
version: [14, 15, 16]
145+
version: [14, 15, 16, 17]
146146
rootless: [true, false]
147147
steps:
148148
- name: Checkout

.github/workflows/release_enterprise.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
binary:
4242
strategy:
4343
matrix:
44-
version: [14, 15, 16]
44+
version: [14, 15, 16, 17]
4545
arch: ["x86_64", "aarch64"]
4646
schema: ["vectors", "extensions", "public"]
4747
runs-on: ubuntu-22.04
@@ -117,7 +117,7 @@ jobs:
117117
needs: ["binary", "semver"]
118118
strategy:
119119
matrix:
120-
version: [14, 15, 16]
120+
version: [14, 15, 16, 17]
121121
platform: ["amd64", "arm64"]
122122
schema: ["vectors", "extensions", "public"]
123123
runs-on: ubuntu-latest
@@ -151,7 +151,7 @@ jobs:
151151
runs-on: ubuntu-latest
152152
strategy:
153153
matrix:
154-
version: [14, 15, 16]
154+
version: [14, 15, 16, 17]
155155
schema: ["vectors", "extensions", "public"]
156156
steps:
157157
- name: Checkout

.github/workflows/rust.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ jobs:
6565
touch ~/.cargo/config.toml
6666
echo 'target.aarch64-unknown-linux-gnu.linker = "aarch64-linux-gnu-gcc"' >> ~/.cargo/config.toml
6767
echo 'target.aarch64-unknown-linux-gnu.runner = ["qemu-aarch64-static", "-L", "/usr/aarch64-linux-gnu"]' >> ~/.cargo/config.toml
68+
rustup target add x86_64-unknown-linux-gnu
69+
rustup target add aarch64-unknown-linux-gnu
6870
- name: Set up Sccache
6971
uses: mozilla-actions/[email protected]
7072
- name: Set up Cache
@@ -95,6 +97,9 @@ jobs:
9597
export PGRX_PG_CONFIG_PATH=$(pwd)/vendor/pg16_${ARCH}_debian/pg_config/pg_config
9698
export PGRX_TARGET_INFO_PATH_PG16=$(pwd)/vendor/pg16_${ARCH}_debian/pgrx_binding
9799
cargo clippy --package pgvectors --features pg16 --no-deps --target $ARCH-unknown-linux-gnu
100+
export PGRX_PG_CONFIG_PATH=$(pwd)/vendor/pg17_${ARCH}_debian/pg_config/pg_config
101+
export PGRX_TARGET_INFO_PATH_PG17=$(pwd)/vendor/pg17_${ARCH}_debian/pgrx_binding
102+
cargo clippy --package pgvectors --features pg17 --no-deps --target $ARCH-unknown-linux-gnu
98103
- name: Build
99104
run: |
100105
cargo build --workspace --exclude pgvectors --exclude pyvectors --target $ARCH-unknown-linux-gnu
@@ -107,6 +112,9 @@ jobs:
107112
export PGRX_PG_CONFIG_PATH=$(pwd)/vendor/pg16_${ARCH}_debian/pg_config/pg_config
108113
export PGRX_TARGET_INFO_PATH_PG16=$(pwd)/vendor/pg16_${ARCH}_debian/pgrx_binding
109114
cargo build --package pgvectors --lib --features pg16 --target $ARCH-unknown-linux-gnu
115+
export PGRX_PG_CONFIG_PATH=$(pwd)/vendor/pg17_${ARCH}_debian/pg_config/pg_config
116+
export PGRX_TARGET_INFO_PATH_PG17=$(pwd)/vendor/pg17_${ARCH}_debian/pgrx_binding
117+
cargo build --package pgvectors --lib --features pg17 --target $ARCH-unknown-linux-gnu
110118
- name: Test
111119
run: |
112120
cargo test --workspace --exclude pgvectors --exclude pyvectors --no-fail-fast --target $ARCH-unknown-linux-gnu

.github/workflows/update_vendor.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,21 @@ jobs:
2626
run: |
2727
export BRANCH=$(grep -o 'pgrx = { git = "https://github.com/tensorchord/pgrx.git", branch = "[^"]*' Cargo.toml | cut -d '"' -f 4)
2828
docker run --rm --platform linux/amd64 -v ./:/mnt/build \
29-
-e "VERSION=14" -e "BRANCH=$BRANCH" debian:buster bash /mnt/build/scripts/update_vendor.sh &
29+
-e "VERSION=14" -e "BRANCH=$BRANCH" debian:bookworm bash /mnt/build/scripts/update_vendor.sh &
3030
docker run --rm --platform linux/amd64 -v ./:/mnt/build \
31-
-e "VERSION=15" -e "BRANCH=$BRANCH" debian:buster bash /mnt/build/scripts/update_vendor.sh &
31+
-e "VERSION=15" -e "BRANCH=$BRANCH" debian:bookworm bash /mnt/build/scripts/update_vendor.sh &
3232
docker run --rm --platform linux/amd64 -v ./:/mnt/build \
33-
-e "VERSION=16" -e "BRANCH=$BRANCH" debian:buster bash /mnt/build/scripts/update_vendor.sh &
33+
-e "VERSION=16" -e "BRANCH=$BRANCH" debian:bookworm bash /mnt/build/scripts/update_vendor.sh &
34+
docker run --rm --platform linux/amd64 -v ./:/mnt/build \
35+
-e "VERSION=17" -e "BRANCH=$BRANCH" debian:bookworm bash /mnt/build/scripts/update_vendor.sh &
36+
docker run --rm --platform linux/arm64 -v ./:/mnt/build \
37+
-e "VERSION=14" -e "BRANCH=$BRANCH" debian:bookworm bash /mnt/build/scripts/update_vendor.sh &
3438
docker run --rm --platform linux/arm64 -v ./:/mnt/build \
35-
-e "VERSION=14" -e "BRANCH=$BRANCH" debian:buster bash /mnt/build/scripts/update_vendor.sh &
39+
-e "VERSION=15" -e "BRANCH=$BRANCH" debian:bookworm bash /mnt/build/scripts/update_vendor.sh &
3640
docker run --rm --platform linux/arm64 -v ./:/mnt/build \
37-
-e "VERSION=15" -e "BRANCH=$BRANCH" debian:buster bash /mnt/build/scripts/update_vendor.sh &
41+
-e "VERSION=16" -e "BRANCH=$BRANCH" debian:bookworm bash /mnt/build/scripts/update_vendor.sh &
3842
docker run --rm --platform linux/arm64 -v ./:/mnt/build \
39-
-e "VERSION=16" -e "BRANCH=$BRANCH" debian:buster bash /mnt/build/scripts/update_vendor.sh &
43+
-e "VERSION=17" -e "BRANCH=$BRANCH" debian:bookworm bash /mnt/build/scripts/update_vendor.sh &
4044
wait
4145
sudo chown -R $USER ./vendor
4246
- name: Create Pull Request

Cargo.lock

Lines changed: 43 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ libc.workspace = true
2828
log.workspace = true
2929
memmap2.workspace = true
3030
paste.workspace = true
31-
pgrx = { version = "=0.12.1", default-features = false, features = [] }
31+
pgrx = { version = "=0.12.5", default-features = false, features = [] }
3232
rand.workspace = true
3333
rustix.workspace = true
3434
serde.workspace = true
@@ -88,7 +88,7 @@ rust.unused_lifetimes = "warn"
8888
rust.unused_qualifications = "warn"
8989

9090
[patch.crates-io]
91-
pgrx = { git = "https://github.com/tensorchord/pgrx.git", branch = "v0.12.1-patch" }
91+
pgrx = { git = "https://github.com/tensorchord/pgrx.git", branch = "v0.12.5-patch" }
9292

9393
[profile.opt]
9494
inherits = "dev"

crates/base/src/scalar/f16.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ mod reduce_sum_of_xy {
410410
a = a.add(1);
411411
b = b.add(1);
412412
n -= 1;
413-
xy = x.mul_add(y, xy);
413+
xy += x * y;
414414
}
415415
xy
416416
}
@@ -615,7 +615,7 @@ mod reduce_sum_of_d2 {
615615
b = b.add(1);
616616
n -= 1;
617617
let d = x - y;
618-
d2 = d.mul_add(d, d2);
618+
d2 += d * d;
619619
}
620620
d2
621621
}

crates/base/src/scalar/f32.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ mod reduce_sum_of_x2 {
547547
let x = a.read();
548548
a = a.add(1);
549549
n -= 1;
550-
x2 = x.mul_add(x, x2);
550+
x2 += x * x;
551551
}
552552
x2
553553
}
@@ -586,7 +586,7 @@ mod reduce_sum_of_x2 {
586586
let n = this.len();
587587
let mut x2 = 0.0f32;
588588
for i in 0..n {
589-
x2 = this[i].mul_add(this[i], x2);
589+
x2 += this[i] * this[i];
590590
}
591591
x2
592592
}
@@ -815,7 +815,7 @@ mod reduce_sum_of_xy {
815815
a = a.add(1);
816816
b = b.add(1);
817817
n -= 1;
818-
xy = x.mul_add(y, xy);
818+
xy += x * y;
819819
}
820820
xy
821821
}
@@ -966,7 +966,7 @@ mod reduce_sum_of_d2 {
966966
b = b.add(1);
967967
n -= 1;
968968
let d = x - y;
969-
d2 = d.mul_add(d, d2);
969+
d2 += d * d;
970970
}
971971
d2
972972
}

crates/quantization/src/quantize.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ mod mul_add_round {
9696
// this hint is used to disable loop unrolling
9797
while std::hint::black_box(n) > 0 {
9898
let x = a.read();
99-
let v = x.mul_add(k, b).round_ties_even() as u8;
99+
let v = (k * x + b).round_ties_even() as u8;
100100
r.write(v);
101101
n -= 1;
102102
a = a.add(1);

rust-toolchain.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
[toolchain]
22
channel = "nightly-2024-09-14"
3-
profile = "default"
4-
components = ["rust-analyzer", "rust-src"]
5-
targets = ["aarch64-unknown-linux-gnu", "x86_64-unknown-linux-gnu"]

src/logger/postgres.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ fn write_pipe_chunks(pid: u32, mut msg: &[u8], dest: LogDestination) {
122122
chunk.extend((len as u16).to_le_bytes());
123123
chunk.extend((pid as i32).to_le_bytes());
124124
#[cfg(feature = "pg14")]
125-
chunk.extend((is_last as u8).to_le_bytes());
125+
chunk.extend(is_last.to_le_bytes());
126126
#[cfg(any(feature = "pg15", feature = "pg16", feature = "pg17"))]
127127
chunk.extend((flags as u8).to_le_bytes());
128128
chunk.extend_from_slice(&msg[..len]);

0 commit comments

Comments
 (0)