Skip to content

Commit 37eca0a

Browse files
committed
use pre-built plrust
1 parent be076e6 commit 37eca0a

File tree

3 files changed

+5
-76
lines changed

3 files changed

+5
-76
lines changed

Dockerfile

Lines changed: 3 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -804,82 +804,11 @@ RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --nodoc
804804
####################
805805
# 30-plrust.yml
806806
####################
807-
FROM ccache as plrust-source
807+
FROM base as plrust-source
808808
ARG plrust_release
809-
ARG plrust_release_checksum
810809
ARG plrust_language_version=1.70.0
811-
ARG plrust_pgrx_version=0.9.7
812-
813-
ADD --checksum=${plrust_release_checksum} \
814-
"https://github.com/tcdi/plrust/archive/refs/tags/v${plrust_release}.tar.gz" \
815-
/tmp/plrust.tar.gz
816-
RUN tar -xvf /tmp/plrust.tar.gz -C /tmp && \
817-
rm -rf /tmp/plrust.tar.gz
818-
819-
RUN apt-get update && apt-get install -y --no-install-recommends \
820-
ca-certificates \
821-
clang \
822-
clang-11 \
823-
gcc \
824-
git \
825-
gnupg \
826-
libssl-dev \
827-
llvm-11 \
828-
lsb-release \
829-
make \
830-
pkg-config \
831-
wget \
832-
&& rm -rf /var/lib/apt/lists/*
833-
834-
# Build from source
835-
WORKDIR /tmp/plrust-${plrust_release}
836-
837-
RUN wget -qO- https://sh.rustup.rs | \
838-
sh -s -- \
839-
-y \
840-
--profile minimal \
841-
--default-toolchain=${plrust_language_version}
842-
843-
# Make sure we have the cargo environment
844-
ENV PATH "/root/.cargo/bin:$PATH"
845-
846-
847-
# Install required Rust components and target
848-
RUN rustup toolchain install ${plrust_language_version} && \
849-
rustup default ${plrust_language_version} && \
850-
rustup component add llvm-tools-preview rustc-dev && \
851-
rustup target install x86_64-unknown-linux-gnu && \
852-
rustup target install aarch64-unknown-linux-gnu
853-
854-
# Install cargo-pgrx
855-
RUN cargo install cargo-pgrx --version ${plrust_pgrx_version} --locked && \
856-
cargo pgrx init --pg${postgresql_major} /usr/bin/pg_config
857-
858-
# build plrustc
859-
RUN cd plrustc && ./build.sh
860-
861-
RUN mv build/bin/plrustc /root/.cargo/bin/
862-
863-
RUN arch=$([ "$TARGETARCH" = "arm64" ] && echo "aarch64" || echo "$TARGETARCH") && \
864-
cd plrust && \
865-
PG_VER=${postgresql_major} \
866-
STD_TARGETS=$arch-postgres-linux-gnu \
867-
./build
868-
869-
RUN cd plrust && cargo pgrx package --profile=release --features trusted -c /usr/bin/pg_config --out-dir=/tmp
870-
871-
# build .deb package
872-
ENV PLRUST_PACKAGE_DIR /tmp/plrust-${plrust_release}-pg${postgresql_major}-$TARGETARCH-unknown-linux-gnu
873-
RUN mkdir -p $PLRUST_PACKAGE_DIR/DEBIAN
874-
RUN touch $PLRUST_PACKAGE_DIR/DEBIAN/control
875-
RUN echo 'Package: plrust' >> $PLRUST_PACKAGE_DIR/DEBIAN/control
876-
RUN echo 'Version: ' ${plrust_release} >> $PLRUST_PACKAGE_DIR/DEBIAN/control
877-
RUN echo 'Architecture: ' $TARGETARCH >> $PLRUST_PACKAGE_DIR/DEBIAN/control
878-
RUN echo 'Maintainer: TCDI' >> $PLRUST_PACKAGE_DIR/DEBIAN/control
879-
RUN echo 'Description: PL for the Rust programming language' >> $PLRUST_PACKAGE_DIR/DEBIAN/control
880-
RUN mv /tmp/usr $PLRUST_PACKAGE_DIR
881-
882-
RUN dpkg-deb --build --root-owner-group $PLRUST_PACKAGE_DIR
810+
ADD "https://github.com/tcdi/plrust/releases/download/v${plrust_release}/plrust-trusted-${plrust_release}_${plrust_language_version}-debian-pg${postgresql_major}-${TARGETARCH}.deb" \
811+
/tmp/plrust.deb
883812

884813
####################
885814
# internal/supautils.yml

ansible/files/postgresql_config/postgresql.conf.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ jit_provider = 'llvmjit' # JIT library to use
693693

694694
# - Other Defaults -
695695

696-
plrust.work_dir = '/tmp'
696+
plrust.work_dir = '/var/lib/postgresql/'
697697

698698
#dynamic_library_path = '$libdir'
699699
#gin_fuzzy_search_limit = 0

common.vars.pkr.hcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
postgres-version = "15.1.0.106-plrust"
1+
postgres-version = "15.1.0.107-plrust"

0 commit comments

Comments
 (0)