Skip to content

Commit

Permalink
Merge pull request #6 from vegaprotocol/toolkit-latest
Browse files Browse the repository at this point in the history
Toolkit latest
  • Loading branch information
EVODelavega authored Nov 6, 2024
2 parents 9647368 + 6d92882 commit d32d912
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 11 deletions.
26 changes: 17 additions & 9 deletions scripts/build-postgres-alpine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,16 @@ $DOCKER_OPTS $IMG_NAME /bin/sh -ex -c 'echo "Starting building postgres binaries
readline-dev \
libxml2-utils \
ccache \
zlib-dev \
libxslt-dev \
g++ \
libgcrypt \
openssl-dev \
musl-dev \
build-base \
libressl-dev \
musl \
musl-dev \
lld \
libressl-dev \
libffi-dev \
tree \
\
&& if [ "$E2FS_ENABLED" = false ]; then \
wget -O uuid.tar.gz "https://www.mirrorservice.org/sites/ftp.ossp.org/pkg/lib/uuid/uuid-1.6.2.tar.gz" \
Expand Down Expand Up @@ -194,16 +194,24 @@ $DOCKER_OPTS $IMG_NAME /bin/sh -ex -c 'echo "Starting building postgres binaries
curl --proto "=https" --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
&& . "$HOME/.cargo/env" \
&& export PATH="/usr/local/pg-build/bin:${PATH}" \
&& rustup target add x86_64-unknown-linux-gnu \
&& cargo install --version "=0.10.2" --force cargo-pgrx \
&& cargo pgrx init --$pgrx_flag pg_config \
&& rustup target add x86_64-unknown-linux-musl \
&& RUSTFLAGS="-C target-feature=-crt-static" cargo install --version "=0.10.2" --force cargo-pgrx \
&& RUSTFLAGS="-C target-feature=-crt-static" cargo pgrx init --$pgrx_flag pg_config \
&& git clone https://github.com/timescale/timescaledb-toolkit && cd timescaledb-toolkit/extension \
&& git checkout 1.18.0 \
&& RUSTFLAGS="-C target-feature=-crt-static" cargo pgrx install --release && cargo run --manifest-path ../tools/post-install/Cargo.toml -- pg_config \
&& RUSTFLAGS="-C target-feature=-crt-static" cargo pgrx install --release && RUSTFLAGS="-C target-feature=-crt-static" cargo run --manifest-path ../tools/post-install/Cargo.toml -- pg_config \
; fi \
\
&& cd /usr/local/pg-build \
&& cp /lib/libuuid.so.1 /lib/libz.so.1 /lib/libssl.so.1.0.0 /lib/libcrypto.so.1.0.0 /usr/lib/libxml2.so.2 /usr/lib/libxslt.so.1 ./lib \
&& cp /lib/libuuid.so.1 /lib/libz.so.1 /usr/lib/libxml2.so.2 /usr/lib/libxslt.so.1 ./lib \
&& if [ -f "/lib/libssl.so.1.1" ]; then \
cp /lib/libssl.so.1.1 ./lib \
; fi \
\
&& if [ -f "/lib/libcrypto.so.1.1" ]; then \
cp /lib/libcrypto.so.1.1 ./lib \
; fi \
\
&& if [ "$ICU_ENABLED" = true ]; then cp --no-dereference /usr/lib/libicudata.so* /usr/lib/libicuuc.so* /usr/lib/libicui18n.so* /usr/lib/libstdc++.so* /usr/lib/libgcc_s.so* ./lib; fi \
&& if [ -n "$POSTGIS_VERSION" ]; then cp --no-dereference /usr/lib/libjson-c.so* /usr/lib/libsqlite3.so* ./lib ; fi \
&& find ./bin -type f \( -name "initdb" -o -name "pg_ctl" -o -name "postgres" \) -print0 | xargs -0 -n1 chrpath -r "\$ORIGIN/../lib" \
Expand Down
13 changes: 12 additions & 1 deletion scripts/build-postgres-darwin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# not really understanding it. Just run it direcly and it should make
# the .zip file for manual upload to github releases.

PG_VERSION=14.1
PG_VERSION=16.4
TIMESCALE_VERSION=2.6.0

ARCH=$(uname -m)
Expand Down Expand Up @@ -54,6 +54,17 @@ find $PREFIX/lib -type f -name "*.so" | \

cd $PREFIX

# install cargo, compile the toolkit
curl --proto "=https" --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
. "$HOME/.cargo/env"
export PATH="${PREFIX}/bin:${PATH}"
rustup target add x86_64-unknown-linux-gnu
cargo install --version "=0.10.2" --force cargo-pgrx
cargo pgrx init --pg16 pg_config
git clone https://github.com/timescale/timescaledb-toolkit && cd timescaledb-toolkit/extension
git checkout 1.18.0
RUSTFLAGS="-C target-feature=-crt-static" cargo pgrx install --release
cargo run --manifest-path ../tools/post-install/Cargo.toml -- pg_config
# Tar it up
tar -cJvf ../embedded-postgres-binaries-darwin-${ARCH}-${PG_VERSION}.0.txz \
share/* \
Expand Down
2 changes: 1 addition & 1 deletion scripts/build-postgres-debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ $DOCKER_OPTS $IMG_NAME /bin/bash -ex -c 'echo "Starting building postgres binari
&& cargo pgrx init --$pgrx_flag pg_config \
&& git clone https://github.com/timescale/timescaledb-toolkit && cd timescaledb-toolkit/extension \
&& git checkout 1.18.0 \
&& cargo pgrx install --release && cargo run --manifest-path ../tools/post-install/Cargo.toml -- pg_config \
&& RUSTFLAGS="-C target-feature=-crt-static" cargo pgrx install --release && cargo run --manifest-path ../tools/post-install/Cargo.toml -- pg_config \
; fi \
\
&& cd /usr/local/pg-build \
Expand Down

0 comments on commit d32d912

Please sign in to comment.