You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ks...@apache.org on 2019/01/11 13:03:51 UTC
[arrow] branch master updated: ARROW-4233: [Packaging] Use Docker
to build source archive
This is an automated email from the ASF dual-hosted git repository.
kszucs pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/master by this push:
new 54b35b4 ARROW-4233: [Packaging] Use Docker to build source archive
54b35b4 is described below
commit 54b35b4c13a8904286eca80bb76d9f4e7b619a87
Author: Kouhei Sutou <ko...@clear-code.com>
AuthorDate: Fri Jan 11 14:03:38 2019 +0100
ARROW-4233: [Packaging] Use Docker to build source archive
Author: Kouhei Sutou <ko...@clear-code.com>
Closes #3376 from kou/packaging-source-use-docker and squashes the following commits:
404efe87 <Kouhei Sutou> Use Docker to build source archive
---
dev/release/02-source.sh | 48 +++++++++++++--------------------------
dev/release/source/Dockerfile | 48 +++++++++++++++++++++++++++++++++++++++
dev/release/source/build.sh | 52 +++++++++++++++++++++++++++++++++++++++++++
3 files changed, 115 insertions(+), 33 deletions(-)
diff --git a/dev/release/02-source.sh b/dev/release/02-source.sh
index e224584..85dee33 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 directory
tar czhf ${tarball} ${tag}
diff --git a/dev/release/source/Dockerfile b/dev/release/source/Dockerfile
new file mode 100644
index 0000000..70ed8aa
--- /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.sh
diff --git a/dev/release/source/build.sh b/dev/release/source/build.sh
new file mode 100755
index 0000000..039d075
--- /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