diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ab18585..2a74b85 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,13 +43,6 @@ jobs: - name: Prepare directories run: bash ci/prepare-dirs.sh - - name: Cache installed dependencies - id: cache-deps - uses: actions/cache@v4 - with: - path: ~/local - key: ${{ inputs.cache_key }} - - name: Cache Arrow third-party downloads id: cache-arrow-thirdparty uses: actions/cache@v4 @@ -62,20 +55,17 @@ jobs: run: bash ci/free-disk-space.sh - name: Build and install Greenplum - if: steps.cache-deps.outputs.cache-hit != 'true' run: bash ci/build-gpdb.sh "${{ inputs.gpdb_repo }}" "${{ inputs.gpdb_ref }}" ${{ inputs.open_gpdb && 'open-gpdb' || '' }} - name: Build and install Arrow 15 - if: steps.cache-deps.outputs.cache-hit != 'true' run: bash ci/build-arrow.sh - name: Build and install gRPC - if: steps.cache-deps.outputs.cache-hit != 'true' run: bash ci/build-grpc.sh - name: Verify open-gpdb defines OPENGPDB if: inputs.open_gpdb - run: bash ci/verify-opengpdb-define.sh + run: bash ci/verify-opengpdb-define.sh - name: Build Tea run: bash ci/build-tea.sh diff --git a/ci/build-gpdb.sh b/ci/build-gpdb.sh index c64e8ad..9b99d91 100644 --- a/ci/build-gpdb.sh +++ b/ci/build-gpdb.sh @@ -1,52 +1,57 @@ #!/usr/bin/env bash -# Build and install Greenplum 6 into $HOME/local/gpdb. -# -# Usage: build-gpdb.sh [open-gpdb] -# -# Passing "open-gpdb" as the third argument enables the fixups needed for the -# open-gpdb fork (see the inline comments below); arenadata/gpdb builds without -# them. set -eo pipefail repo="$1" ref="$2" -mode="${3:-}" -git clone "$repo" -b "$ref" --depth 1 gpdb -cd gpdb -git submodule update --init +mode="${3:-}" -configure_extra=() if [ "$mode" = "open-gpdb" ]; then - # ORCA in open-gpdb still builds with -std=c++98/gnu++98, but the system - # Xerces-C 3.2 (Ubuntu 22.04) requires C++11 (char16_t); bump the ORCA C++ - # standard to gnu++14 (gnu++17 would reject ORCA's deprecated throw() specs). - # gnu++14 + -Wextra then surfaces -Wdeprecated-copy / -Wnonnull-compare which - # ORCA's -Werror turns fatal, so append -Wno-error=... last (wins over it). + git clone "$repo" -b "$ref" --depth 1 gpdb + cd gpdb + git submodule update --init + + configure_extra=() for mk in src/backend/gpopt/gpopt.mk \ src/backend/gporca/gporca.mk \ src/backend/gporca/libgpos/src/common/Makefile; do sed -i 's/-std=gnu++98/-std=gnu++14/g; s/-std=c++98/-std=gnu++14/g' "$mk" printf '\noverride CPPFLAGS := $(CPPFLAGS) -Wno-error=deprecated-copy -Wno-error=nonnull-compare\n' >> "$mk" done - # open-gpdb defaults --with-mdblocales=yes and hard-requires the mdblocales - # lib/header, which is not available on the CI image. configure_extra+=(--without-mdblocales) -fi -# TODO(gmusya): consider using --enable-cassert -./configure --with-perl --with-python --with-libxml --with-gssapi \ - --with-pythonsrc-ext "${configure_extra[@]}" --prefix="$HOME/local/gpdb" + ./configure --with-perl --with-python --with-libxml --with-gssapi \ + --with-pythonsrc-ext "${configure_extra[@]}" --prefix="$HOME/local/gpdb" -if [ "$mode" = "open-gpdb" ]; then - # src/common (FRONTEND) includes the backend-generated utils/errcodes.h but - # has no order-only dep on it, so -j8 races ("errcodes.h: No such file"). - # Force the generated header first. make -C src/backend submake-errcodes + make -j8 + make -j8 install + + cd .. + rm -rf gpdb + exit 0 fi -make -j8 -make -j8 install +TARGET_DIR="$HOME/local/gpdb" +PACKAGE_URL="https://github.com/GreengageDB/greengage/releases/download/6.29.2/greengage6.deb" + +deb_file=$(mktemp --suffix=.deb) +curl -sL -o "$deb_file" "$PACKAGE_URL" +mkdir -p "$TARGET_DIR" +sudo dpkg -x "$deb_file" "$TARGET_DIR" +rm -f "$deb_file" + +sudo chown -R "$USER:$USER" "$TARGET_DIR" + +SRC_PATH="$TARGET_DIR/opt/greengagedb/greengage" +if [ -d "$SRC_PATH" ]; then + mv "$SRC_PATH"/* "$TARGET_DIR/" + mv "$SRC_PATH"/.* "$TARGET_DIR/" 2>/dev/null || true + rm -rf "$TARGET_DIR/opt" +fi + +if [ -f "$TARGET_DIR/greengage_path.sh" ]; then + ln -sf greengage_path.sh "$TARGET_DIR/greenplum_path.sh" +fi -cd .. -rm -rf gpdb +"$TARGET_DIR/bin/postgres" --version >/dev/null 2>&1