Apache DataFusion SQL Query Engine
ARROW-4233: [Packaging] Use Docker to build source archive
Kouhei Sutou2451d1d1772d
diff --git a/dev/release/02-source.sh b/dev/release/02-source.shindex e224584223..85dee3302e 100755--- a/dev/release/02-source.sh+++ b/dev/release/02-source.sh@@ -45,46 +45,28 @@ echo "Using commit $release_hash"tarball=${tag}.tar.gz-extract_dir=tmp-apache-arrow-rm -rf ${extract_dir}+archive_name=tmp-apache-arrow# be conservative and use the release hash, even though git produces the same# archive (identical hashes) using the scm tag-git archive ${release_hash} --prefix ${extract_dir}/ | tar xf ---# build Apache Arrow C++ before building Apache Arrow GLib because-# Apache Arrow GLib requires Apache Arrow C++.-mkdir -p ${extract_dir}/cpp/build-cpp_install_dir=${PWD}/${extract_dir}/cpp/install-cd ${extract_dir}/cpp/build-cmake .. \- -DCMAKE_INSTALL_PREFIX=${cpp_install_dir} \- -DCMAKE_INSTALL_LIBDIR=${cpp_install_dir}/lib \- -DARROW_BUILD_TESTS=no \- -DARROW_PARQUET=yes-make -j8-make install-cd ---# build source archive for Apache Arrow GLib by "make dist".-cd ${extract_dir}/c_glib-./autogen.sh-./configure \- PKG_CONFIG_PATH=$cpp_install_dir/lib/pkgconfig \- --enable-gtk-doc-LD_LIBRARY_PATH=$cpp_install_dir/lib:$LD_LIBRARY_PATH make -j8-make dist-tar xzf *.tar.gz-rm *.tar.gz-cd --rm -rf tmp-c_glib/-mv ${extract_dir}/c_glib/apache-arrow-glib-* tmp-c_glib/-rm -rf ${extract_dir}+git archive ${release_hash} --prefix ${archive_name}/ > ${archive_name}.tar.gz++dist_c_glib_tar_gz=c_glib.tar.gz+docker_image_name=apache-arrow/release-source+DEBUG=yes docker build -t ${docker_image_name} ${SOURCE_DIR}/source+docker \+ run \+ --rm \+ --interactive \+ --volume "$PWD":/host \+ ${docker_image_name} \+ /build.sh ${archive_name} ${dist_c_glib_tar_gz}# replace c_glib/ by tar.gz generated by "make dist"rm -rf ${tag}git archive $release_hash --prefix ${tag}/ | tar xf -rm -rf ${tag}/c_glib-mv tmp-c_glib ${tag}/c_glib+tar xf ${dist_c_glib_tar_gz} -C ${tag}+rm -f ${dist_c_glib_tar_gz}# Create new tarball from modified source directorytar czhf ${tarball} ${tag}diff --git a/dev/release/source/Dockerfile b/dev/release/source/Dockerfilenew file mode 100644index 0000000000..70ed8aa866--- /dev/null+++ b/dev/release/source/Dockerfile@@ -0,0 +1,48 @@+# Licensed to the Apache Software Foundation (ASF) under one+# or more contributor license agreements. See the NOTICE file+# distributed with this work for additional information+# regarding copyright ownership. The ASF licenses this file+# to you under the Apache License, Version 2.0 (the+# "License"); you may not use this file except in compliance+# with the License. You may obtain a copy of the License at+#+# http://www.apache.org/licenses/LICENSE-2.0+#+# Unless required by applicable law or agreed to in writing,+# software distributed under the License is distributed on an+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY+# KIND, either express or implied. See the License for the+# specific language governing permissions and limitations+# under the License.++FROM ubuntu:18.04++ENV DEBIAN_FRONTEND noninteractive++RUN \+ apt update && \+ apt install -y -V \+ autoconf-archive \+ bison \+ clang-6.0 \+ cmake \+ flex \+ g++ \+ gcc \+ gtk-doc-tools \+ libboost-filesystem-dev \+ libboost-regex-dev \+ libboost-system-dev \+ libgirepository1.0-dev \+ libglib2.0-doc \+ libprotobuf-dev \+ libprotoc-dev \+ libtool \+ lsb-release \+ make \+ pkg-config \+ protobuf-compiler && \+ apt clean && \+ rm -rf /var/lib/apt/lists/*++COPY build.sh /build.shdiff --git a/dev/release/source/build.sh b/dev/release/source/build.shnew file mode 100755index 0000000000..039d07591f--- /dev/null+++ b/dev/release/source/build.sh@@ -0,0 +1,52 @@+#!/bin/bash+#+# Licensed to the Apache Software Foundation (ASF) under one+# or more contributor license agreements. See the NOTICE file+# distributed with this work for additional information+# regarding copyright ownership. The ASF licenses this file+# to you under the Apache License, Version 2.0 (the+# "License"); you may not use this file except in compliance+# with the License. You may obtain a copy of the License at+#+# http://www.apache.org/licenses/LICENSE-2.0+#+# Unless required by applicable law or agreed to in writing,+# software distributed under the License is distributed on an+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY+# KIND, either express or implied. See the License for the+# specific language governing permissions and limitations+# under the License.++set -e++archive_name=$1+dist_c_glib_tar_gz=$2++tar xf /host/${archive_name}.tar.gz++# build Apache Arrow C++ before building Apache Arrow GLib because+# Apache Arrow GLib requires Apache Arrow C++.+mkdir -p ${archive_name}/cpp/build+cpp_install_dir=${PWD}/${archive_name}/cpp/install+cd ${archive_name}/cpp/build+cmake .. \+ -DCMAKE_INSTALL_PREFIX=${cpp_install_dir} \+ -DCMAKE_INSTALL_LIBDIR=lib \+ -DARROW_PARQUET=yes+make -j8+make install+cd -++# build source archive for Apache Arrow GLib by "make dist".+cd ${archive_name}/c_glib+./autogen.sh+./configure \+ PKG_CONFIG_PATH=${cpp_install_dir}/lib/pkgconfig \+ --enable-gtk-doc+LD_LIBRARY_PATH=${cpp_install_dir}/lib make -j8+make dist+tar xzf *.tar.gz+rm *.tar.gz+cd -+mv ${archive_name}/c_glib/apache-arrow-glib-* c_glib/+tar czf /host/${dist_c_glib_tar_gz} c_glib