1
0
mirror of https://github.com/tensorchord/pgvecto.rs.git synced 2025-07-29 08:21:12 +03:00

feat: mmap transport for macos (#137)

* feat: mmap transport for macos

Signed-off-by: usamoi <usamoi@outlook.com>

* fix: building with feature pg12, pg13

Signed-off-by: usamoi <usamoi@outlook.com>

* fix: call unlink for shmem

Signed-off-by: usamoi <usamoi@outlook.com>

* fix: reduce shmem filename on macos

Signed-off-by: usamoi <usamoi@outlook.com>

* chore: enable testing on all Postgresql versions

Signed-off-by: usamoi <usamoi@outlook.com>

* fix: use file instead of shmem for macos

Signed-off-by: usamoi <usamoi@outlook.com>

* chore: select simpler matrix for pull requests in CI

Signed-off-by: usamoi <usamoi@outlook.com>

* fix: remove macos-latest-16

Signed-off-by: usamoi <usamoi@outlook.com>

* chore: reduce use of nightly features

Signed-off-by: usamoi <usamoi@outlook.com>

---------

Signed-off-by: usamoi <usamoi@outlook.com>
This commit is contained in:
Usamoi
2023-11-18 00:26:15 +08:00
committed by GitHub
parent f6e382d0fc
commit 39e8ee9797
26 changed files with 483 additions and 305 deletions

13
scripts/ci_install.sh Executable file
View File

@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -e
cargo pgrx install --no-default-features --features "pg$VERSION" --release
psql -c 'ALTER SYSTEM SET shared_preload_libraries = "vectors.so"'
if [ "$OS" == "ubuntu-latest" ]; then
sudo systemctl restart postgresql
pg_lsclusters
fi
if [ "$OS" == "macos-latest" ]; then
brew services restart postgresql@$VERSION
fi

39
scripts/ci_setup.sh Executable file
View File

@ -0,0 +1,39 @@
#!/usr/bin/env bash
set -e
if [ "$OS" == "ubuntu-latest" ]; then
if [ $VERSION != 14 ]; then
sudo pg_dropcluster 14 main
fi
sudo apt-get remove -y '^postgres.*' '^libpq.*' '^clang.*' '^llvm.*' '^libclang.*' '^libllvm.*' '^mono-llvm.*'
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 -
sudo apt-get update
sudo apt-get -y install build-essential libpq-dev postgresql-$VERSION postgresql-server-dev-$VERSION
echo "local all all trust" | sudo tee /etc/postgresql/$VERSION/main/pg_hba.conf
echo "host all all 127.0.0.1/32 trust" | sudo tee -a /etc/postgresql/$VERSION/main/pg_hba.conf
echo "host all all ::1/128 trust" | sudo tee -a /etc/postgresql/$VERSION/main/pg_hba.conf
pg_lsclusters
sudo systemctl restart postgresql
pg_lsclusters
sudo -iu postgres createuser -s -r runner
createdb
fi
if [ "$OS" == "macos-latest" ]; then
brew uninstall postgresql
brew install postgresql@$VERSION
export PATH="$PATH:$(brew --prefix postgresql@$VERSION)/bin"
echo "$(brew --prefix postgresql@$VERSION)/bin" >> $GITHUB_PATH
brew services start postgresql@$VERSION
sleep 30
createdb
fi
sudo chmod -R 777 `pg_config --pkglibdir`
sudo chmod -R 777 `pg_config --sharedir`/extension
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
cargo binstall sqllogictest-bin -y --force
cargo install cargo-pgrx --version $(grep '^pgrx ' Cargo.toml | awk -F'\"' '{print $2}') --debug
cargo pgrx init --pg$VERSION=$(which pg_config)