Skip to content

Commit

Permalink
fix cargo config for mac
Browse files Browse the repository at this point in the history
  • Loading branch information
var77 committed Oct 11, 2024
1 parent da8dc5e commit a6040b2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
9 changes: 9 additions & 0 deletions ci/scripts/build-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions ci/scripts/build-mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]]
Expand Down
9 changes: 0 additions & 9 deletions ci/scripts/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a6040b2

Please sign in to comment.