Skip to content

Apache DataFusion SQL Query Engine

ARROW-11256: [Packaging][Linux] Don't buffer packaging output

Sutou Kouheic10a64800e9a
diff --git a/dev/tasks/linux-packages/apache-arrow/yum/arrow.spec.in b/dev/tasks/linux-packages/apache-arrow/yum/arrow.spec.in
index 73b7dbaeb7..f652b40794 100644
--- a/dev/tasks/linux-packages/apache-arrow/yum/arrow.spec.in
+++ b/dev/tasks/linux-packages/apache-arrow/yum/arrow.spec.in
@@ -143,7 +143,7 @@ cd cpp/build
%endif
%if %{use_ninja}
-ninja
+ninja %{?_smp_mflags}
%else
make %{?_smp_mflags}
%endif
@@ -159,7 +159,7 @@ meson setup build \
-Darrow_cpp_build_dir=../cpp/build \
-Darrow_cpp_build_type=$cpp_build_type \
-Dgtk_doc=true
-LD_LIBRARY_PATH=$PWD/../cpp/build/$cpp_build_type ninja -C build
+LD_LIBRARY_PATH=$PWD/../cpp/build/$cpp_build_type ninja -C build %{?_smp_mflags}
%else
./autogen.sh
%configure \
diff --git a/dev/tasks/linux-packages/apt/build.sh b/dev/tasks/linux-packages/apt/build.sh
index 34ea85aed6..dab579505e 100755
--- a/dev/tasks/linux-packages/apt/build.sh
+++ b/dev/tasks/linux-packages/apt/build.sh
@@ -69,7 +69,7 @@ elif [ -d "/host/tmp/debian.${platform}" ]; then
else
run cp -rp "/host/tmp/debian" debian
fi
-DEB_BUILD_OPTIONS="parallel=$(nproc)"
+: ${DEB_BUILD_OPTIONS:="parallel=$(nproc)"}
# DEB_BUILD_OPTIONS="${DEB_BUILD_OPTIONS} noopt"
export DEB_BUILD_OPTIONS
if [ "${DEBUG:-no}" = "yes" ]; then
diff --git a/dev/tasks/linux-packages/package-task.rb b/dev/tasks/linux-packages/package-task.rb
index b66dd5ed14..e6a6e2d8ed 100644
--- a/dev/tasks/linux-packages/package-task.rb
+++ b/dev/tasks/linux-packages/package-task.rb
@@ -136,10 +136,16 @@ class PackageTask
"docker",
"run",
"--rm",
- "--tty",
+ "--log-driver", "none",
"--volume", "#{Dir.pwd}:/host:rw",
]
- run_command_line << "--interactive" if $stdin.tty?
+ if $stdin.tty?
+ run_command_line << "--interactive"
+ run_command_line << "--tty"
+ else
+ run_command_line.concat(["--attach", "STDOUT"])
+ run_command_line.concat(["--attach", "STDERR"])
+ end
build_dir = ENV["BUILD_DIR"]
if build_dir
build_dir = "#{File.expand_path(build_dir)}/#{id}"
@@ -150,6 +156,15 @@ class PackageTask
build_command_line.concat(["--build-arg", "DEBUG=yes"])
run_command_line.concat(["--env", "DEBUG=yes"])
end
+ pass_through_env_names = [
+ "DEB_BUILD_OPTIONS",
+ "RPM_BUILD_NCPUS",
+ ]
+ pass_through_env_names.each do |name|
+ value = ENV[name]
+ next unless value
+ run_command_line.concat(["--env", "#{name}=#{value}"])
+ end
if File.exist?(File.join(id, "Dockerfile"))
docker_context = id
else
diff --git a/dev/tasks/linux-packages/travis.linux.arm64.yml b/dev/tasks/linux-packages/travis.linux.arm64.yml
index d082f8194a..e67e1f71d3 100644
--- a/dev/tasks/linux-packages/travis.linux.arm64.yml
+++ b/dev/tasks/linux-packages/travis.linux.arm64.yml
@@ -51,7 +51,13 @@ script:
- rake version:update
- |
rake docker:pull || :
- - rake BUILD_DIR=build {{ build_task }}
+ - |
+ stdbuf --output=0 \
+ rake \
+ BUILD_DIR=build \
+ DEB_BUILD_OPTIONS=parallel=8 \
+ RPM_BUILD_NCPUS=8 \
+ {{ build_task }}
- sudo rm -rf */*/build
- popd