|
| 1 | +#!/bin/bash |
| 2 | +# |
| 3 | +# Licensed to the Apache Software Foundation (ASF) under one |
| 4 | +# or more contributor license agreements. See the NOTICE file |
| 5 | +# distributed with this work for additional information |
| 6 | +# regarding copyright ownership. The ASF licenses this file |
| 7 | +# to you under the Apache License, Version 2.0 (the |
| 8 | +# "License"); you may not use this file except in compliance |
| 9 | +# with the License. You may obtain a copy of the License at |
| 10 | +# |
| 11 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | +# |
| 13 | +# Unless required by applicable law or agreed to in writing, |
| 14 | +# software distributed under the License is distributed on an |
| 15 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 16 | +# KIND, either express or implied. See the License for the |
| 17 | +# specific language governing permissions and limitations |
| 18 | +# under the License. |
| 19 | +# |
| 20 | + |
| 21 | +# Test the validation script using system dependencies instead of Conda. This |
| 22 | +# script is meant for automation (e.g. Docker), not a local/developer machine |
| 23 | +# (except via Docker). |
| 24 | + |
| 25 | +set -euo pipefail |
| 26 | + |
| 27 | +main() { |
| 28 | + local -r source_dir="${1}" |
| 29 | + |
| 30 | + # Install all the dependencies we need for all the subprojects |
| 31 | + |
| 32 | + # When installing tzdata, don't block and wait for user input |
| 33 | + export DEBIAN_FRONTEND=noninteractive |
| 34 | + export TZ=Etc/UTC |
| 35 | + |
| 36 | + apt update |
| 37 | + apt install -y \ |
| 38 | + apt-transport-https \ |
| 39 | + build-essential \ |
| 40 | + ca-certificates \ |
| 41 | + cmake \ |
| 42 | + curl \ |
| 43 | + dirmngr \ |
| 44 | + git \ |
| 45 | + gobject-introspection \ |
| 46 | + gpg \ |
| 47 | + libgirepository1.0-dev \ |
| 48 | + libglib2.0-dev \ |
| 49 | + libgmock-dev \ |
| 50 | + libgtest-dev \ |
| 51 | + libpq-dev \ |
| 52 | + libsqlite3-dev \ |
| 53 | + lsb-release \ |
| 54 | + ninja-build \ |
| 55 | + pkg-config \ |
| 56 | + protobuf-compiler \ |
| 57 | + python3 \ |
| 58 | + python3-dev \ |
| 59 | + python3-pip \ |
| 60 | + python3-venv \ |
| 61 | + r-base \ |
| 62 | + ruby-full \ |
| 63 | + software-properties-common \ |
| 64 | + wget |
| 65 | + |
| 66 | + # Install Java |
| 67 | + |
| 68 | + wget -qO - https://packages.adoptium.net/artifactory/api/gpg/key/public | \ |
| 69 | + gpg --dearmor | \ |
| 70 | + tee /etc/apt/trusted.gpg.d/adoptium.gpg > /dev/null |
| 71 | + |
| 72 | + echo "deb https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | \ |
| 73 | + tee /etc/apt/sources.list.d/adoptium.list |
| 74 | + |
| 75 | + # Install Arrow GLib |
| 76 | + wget https://packages.apache.org/artifactory/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb |
| 77 | + apt install -y -V ./apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb |
| 78 | + |
| 79 | + apt update |
| 80 | + apt install -y \ |
| 81 | + libarrow-dev \ |
| 82 | + libarrow-glib-dev \ |
| 83 | + temurin-21-jdk |
| 84 | + |
| 85 | + # Install Maven |
| 86 | + wget https://dlcdn.apache.org/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.tar.gz |
| 87 | + mkdir -p /opt/maven |
| 88 | + tar -C /opt/maven -xzvf apache-maven-3.9.9-bin.tar.gz --strip-components=1 |
| 89 | + export PATH=/opt/maven/bin:$PATH |
| 90 | + |
| 91 | + # Check if protoc is too old (Ubuntu 22.04). If so, install it from |
| 92 | + # upstream instead. |
| 93 | + if ! protoc --version | \ |
| 94 | + awk '{print $2}{print "3.15"}' | \ |
| 95 | + sort --version-sort | \ |
| 96 | + head -n1 | \ |
| 97 | + grep -E '^3\.15.*$' >/dev/null ; then |
| 98 | + echo "protoc is too old" |
| 99 | + |
| 100 | + wget -O protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v30.2/protoc-30.2-linux-x86_64.zip |
| 101 | + unzip -o protoc.zip -d /usr/local -x readme.txt |
| 102 | + fi |
| 103 | + |
| 104 | + # We run under Docker and this is necessary since the source dir is |
| 105 | + # typically mounted as a volume |
| 106 | + git config --global --add safe.directory "${source_dir}" |
| 107 | + |
| 108 | + "${source_dir}/dev/release/verify-release-candidate.sh" |
| 109 | +} |
| 110 | + |
| 111 | +main "$@" |
0 commit comments