Skip to content

Commit

Permalink
move rust setup to utils.hs
Browse files Browse the repository at this point in the history
  • Loading branch information
var77 committed Oct 11, 2024
1 parent bd7886f commit da8dc5e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
17 changes: 0 additions & 17 deletions ci/scripts/build-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,6 @@ function setup_postgres() {
echo "port = 5432" >> /etc/postgresql/$PG_VERSION/main/postgresql.conf
}

function setup_rust() {
if [ ! -f /tmp/rustup.sh ]; then
curl -k -o /tmp/rustup.sh https://sh.rustup.rs
chmod +x /tmp/rustup.sh
/tmp/rustup.sh -y --default-toolchain=1.78.0
fi
. "$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 install_platform_specific_dependencies() {
# Currently lantern_extras binaries are only available for Linux x86_64
Expand Down
18 changes: 18 additions & 0 deletions ci/scripts/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,24 @@ function setup_environment() {
export PG_CRON_COMMIT_SHA=7e91e72b1bebc5869bb900d9253cc9e92518b33f
}

function setup_rust() {
if [ ! -f /tmp/rustup.sh ]; then
curl -k -o /tmp/rustup.sh https://sh.rustup.rs
chmod +x /tmp/rustup.sh
/tmp/rustup.sh -y --default-toolchain=1.78.0
fi
. "$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 da8dc5e

Please sign in to comment.