diff --git a/ci/scripts/build-linux.sh b/ci/scripts/build-linux.sh index 3ba50b91..9b984629 100755 --- a/ci/scripts/build-linux.sh +++ b/ci/scripts/build-linux.sh @@ -15,6 +15,15 @@ function setup_locale_and_install_packages() { locale-gen en_US.UTF-8 } +function setup_cargo_deps() { + if [ ! -d .cargo ]; then + mkdir .cargo + fi + echo "[target.$(rustc -vV | sed -n 's|host: ||p')]" >> .cargo/config + cargo install cargo-pgrx --version 0.11.3 + cargo pgrx init "--pg$PG_VERSION" /usr/bin/pg_config +} + function setup_postgres() { # Add postgresql apt repo echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list diff --git a/ci/scripts/build-mac.sh b/ci/scripts/build-mac.sh index 0c54fb56..0eea0493 100755 --- a/ci/scripts/build-mac.sh +++ b/ci/scripts/build-mac.sh @@ -10,6 +10,20 @@ function setup_locale_and_install_packages() { export CXX=/usr/bin/clang++ } +function setup_cargo_deps() { + if [ ! -d .cargo ]; then + mkdir .cargo + else + rm -rf .cargo + fi + + echo "[target.$(rustc -vV | sed -n 's|host: ||p')]" >> .cargo/config + echo 'rustflags = ["-Clink-arg=-Wl,-undefined,dynamic_lookup"]' >> .cargo/config + + cargo install cargo-pgrx --version 0.11.3 + cargo pgrx init "--pg$PG_VERSION" /usr/bin/pg_config +} + function setup_postgres() { cmd="brew install postgresql@${PG_VERSION} clang-format || true" # ignoring brew linking errors if [[ $USER == "root" ]] diff --git a/ci/scripts/utils.sh b/ci/scripts/utils.sh index 74387a09..4183c281 100644 --- a/ci/scripts/utils.sh +++ b/ci/scripts/utils.sh @@ -21,15 +21,6 @@ function setup_rust() { . "$HOME/.cargo/env" } -function setup_cargo_deps() { - if [ ! -d .cargo ]; then - mkdir .cargo - fi - echo "[target.$(rustc -vV | sed -n 's|host: ||p')]" >> .cargo/config - cargo install cargo-pgrx --version 0.11.3 - cargo pgrx init "--pg$PG_VERSION" /usr/bin/pg_config -} - function clone_or_use_source() { if [ -z ${USE_SOURCE} ]; then # Clone from git