diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ab18585..8d1b547 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -61,9 +61,54 @@ jobs: if: inputs.open_gpdb 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: Install Debian packages + run: | + TARGET_DIR="$HOME/local/gpdb" + EXPECTED_SCRIPT="greenplum_path.sh" + TEMP_DIR="$HOME/local/gp_temp_install" + + if [ "${{ inputs.open_gpdb }}" == "true" ]; then + PACKAGE_URL="https://github.com/open-gpdb/gpdb/releases/download/6.29.8/greenplum-db-6_6.29.8-1-yandex.54453.5ad8245cbc_amd64.deb" + echo "Installing open-gpdb..." + else + PACKAGE_URL="https://github.com/GreengageDB/greengage/releases/download/6.29.2/greengage6.deb" + echo "Installing Greengage..." + fi + + mkdir -p "$TEMP_DIR" + wget -q "$PACKAGE_URL" -O /tmp/gp.deb + sudo apt-get remove -y python-is-python3 || true + sudo dpkg -x /tmp/gp.deb "$TEMP_DIR" + rm -f /tmp/gp.deb + + REAL_SOURCE=$(find "$TEMP_DIR" -type d -exec test -f {}/"$EXPECTED_SCRIPT" \; -print -quit 2>/dev/null) + if [ -z "$REAL_SOURCE" ]; then + FOUND_SCRIPT=$(find "$TEMP_DIR" -type f -name "*_path.sh" | head -n 1) + [ -n "$FOUND_SCRIPT" ] && REAL_SOURCE=$(dirname "$FOUND_SCRIPT") && EXPECTED_SCRIPT=$(basename "$FOUND_SCRIPT") + fi + + if [ -z "$REAL_SOURCE" ]; then + echo "ERROR: Installation directory not found" >&2; exit 1 + fi + + sudo rm -rf "$TARGET_DIR" + sudo mv "$REAL_SOURCE" "$TARGET_DIR" + sudo rm -rf "$TEMP_DIR" + + sudo chown -R "$USER:$USER" "$TARGET_DIR" + + if [ "$(basename "$EXPECTED_SCRIPT")" != "greenplum_path.sh" ]; then + ln -s "$EXPECTED_SCRIPT" "$TARGET_DIR/greenplum_path.sh" + fi + + source "$TARGET_DIR/greenplum_path.sh" + echo "Greenplum ready at: $GPHOME" + + - name: Build and install Arrow 15 + run: bash ci/build-arrow.sh + + - name: Build and install gRPC + run: bash ci/build-grpc.sh - name: Build and install Arrow 15 if: steps.cache-deps.outputs.cache-hit != 'true' @@ -73,10 +118,6 @@ jobs: 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 - - name: Build Tea run: bash ci/build-tea.sh diff --git a/ci/build-gpdb.sh b/ci/build-gpdb.sh deleted file mode 100644 index c64e8ad..0000000 --- a/ci/build-gpdb.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/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 - -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). - 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" - -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 -fi - -make -j8 -make -j8 install - -cd .. -rm -rf gpdb diff --git a/ci/verify-opengpdb-define.sh b/ci/verify-opengpdb-define.sh deleted file mode 100644 index 53d490c..0000000 --- a/ci/verify-opengpdb-define.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash -# tea relies on the OPENGPDB macro (defined in pg_config_manual.h) to select -# the open-gpdb sampling API; make sure the freshly built gpdb defines it. -set -ex - -grep -q '#define OPENGPDB' \ - "$HOME/local/gpdb/include/postgresql/server/pg_config_manual.h"