Skip to content

Commit

Permalink
ARROW-8724: [Packaging][deb][RPM] Use directory in host as build dire…
Browse files Browse the repository at this point in the history
…ctory

Travis CI uses different partition for workspace (/) and
Docker (/var/lib/docker/) and /var/lib/docker/ doesn't have enough
disk space. If we use directory in host as build directory, we can use
disk space in /.

Closes #7118 from kou/packaging-linux-build-in-host-directory

Authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
  • Loading branch information
kou committed May 8, 2020
1 parent 7fda36c commit 6bd00e9
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 9 deletions.
4 changes: 4 additions & 0 deletions dev/tasks/linux-packages/apache-arrow/yum/centos-7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,7 @@ RUN \
tar \
zlib-devel && \
yum clean ${quiet} all

ENV \
BOOST_INCLUDEDIR=/usr/include/boost169 \
BOOST_LIBRARYDIR=/usr/lib64/boost169
2 changes: 1 addition & 1 deletion dev/tasks/linux-packages/github.linux.amd64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
pushd arrow/dev/tasks/linux-packages
rake version:update
rake docker:pull || :
rake {{ build_task }}
rake BUILD_DIR=build {{ build_task }}
popd
env:
APT_TARGETS: {{ target }}
Expand Down
7 changes: 7 additions & 0 deletions dev/tasks/linux-packages/package-task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,13 @@ def docker_run(os, architecture)
"--tty",
"--volume", "#{Dir.pwd}:/host:rw",
]
run_command_line << "--interactive" if $stdin.tty?
build_dir = ENV["BUILD_DIR"]
if build_dir
build_dir = "#{File.expand_path(build_dir)}/#{id}"
mkdir_p(build_dir)
run_command_line.concat(["--volume", "#{build_dir}:/build:rw"])
end
if debug_build?
build_command_line.concat(["--build-arg", "DEBUG=yes"])
run_command_line.concat(["--env", "DEBUG=yes"])
Expand Down
2 changes: 1 addition & 1 deletion dev/tasks/linux-packages/travis.linux.arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ script:
- rake version:update
- |
rake docker:pull || :
- rake {{ build_task }}
- rake BUILD_DIR=build {{ build_task }}
- popd

after_success:
Expand Down
16 changes: 9 additions & 7 deletions dev/tasks/linux-packages/yum/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,22 @@ case "${architecture}" in
;;
esac

cd

run mkdir -p /build/rpmbuild
run ln -fs /build/rpmbuild ./
if [ -x /usr/bin/rpmdev-setuptree ]; then
rm -rf .rpmmacros
run rpmdev-setuptree
else
run cat <<EOM > ~/.rpmmacros
%_topdir ${HOME}/rpmbuild
EOM
run mkdir -p ~/rpmbuild/SOURCES
run mkdir -p ~/rpmbuild/SPECS
run mkdir -p ~/rpmbuild/BUILD
run mkdir -p ~/rpmbuild/RPMS
run mkdir -p ~/rpmbuild/SRPMS
run mkdir -p rpmbuild/SOURCES
run mkdir -p rpmbuild/SPECS
run mkdir -p rpmbuild/BUILD
run mkdir -p rpmbuild/RPMS
run mkdir -p rpmbuild/SRPMS
fi

repositories="/host/repositories"
Expand All @@ -71,8 +75,6 @@ run mkdir -p "${rpm_dir}" "${srpm_dir}"
# for debug
# rpmbuild_options="$rpmbuild_options --define 'optflags -O0 -g3'"

cd

if [ -n "${SOURCE_ARCHIVE}" ]; then
case "${RELEASE}" in
0.dev*)
Expand Down

0 comments on commit 6bd00e9

Please sign in to comment.