Skip to content

Commit 81af52f

Browse files
committed
[CI] issue: HPCINFRA-1736 improve DEB build time
Add parallel compilation flag (-j) to DEB builds to improve compile time. Signed-off-by: Noam Tsemah <[email protected]>
1 parent 6689188 commit 81af52f

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

contrib/build_pkg.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ if [ $opt_binpkg -eq 1 -a "$rc" -eq 0 ]; then
179179
eval rpmbuild -bb $rpmmacros $rpmopts $rpmspec $opt_defines >> ${pkg_log} 2>&1
180180
else
181181
IFS=$':'
182-
env $(echo $opt_exports | xargs) dpkg-buildpackage -us -uc -b >> ${pkg_log} 2>&1
182+
env $(echo $opt_exports | xargs) make_opt="${make_opt}" dpkg-buildpackage -us -uc -b >> ${pkg_log} 2>&1
183183
rc=$((rc + $?))
184184
unset IFS
185185
fi
@@ -192,30 +192,30 @@ if [ $opt_tarpkg -eq 1 ]; then
192192
# Get version for directory name
193193
tarball_name=$(basename ${pkg_tarball})
194194
tarball_root_dir=${tarball_name%.tar.gz}
195-
195+
196196
# Create a temporary directory using mktemp instead of a fixed name
197197
tarball_tmp=$(mktemp -d -p ${pkg_dir}) >> ${pkg_log} 2>&1
198198
tar -xzf ${pkg_tarball} -C ${tarball_tmp} >> ${pkg_log} 2>&1
199199
if [ $? -ne 0 ]; then
200200
echo "ERROR: Failed to extract tarball ${pkg_tarball}. Exit" >> ${pkg_log}
201201
exit 1
202202
fi
203-
203+
204204
# Move spec file to the root directory to support rpmbuild
205205
cp ${pkg_dir}/contrib/scripts/${pkg_spec} ${tarball_tmp}/${tarball_root_dir}/ >> ${pkg_log} 2>&1
206206
# Remove the duplicate spec file
207207
rm ${tarball_tmp}/${tarball_root_dir}/contrib/scripts/${pkg_spec} >> ${pkg_log} 2>&1
208-
208+
209209
# Create new tarball with proper structure
210210
pushd ${tarball_tmp} >> ${pkg_log} 2>&1
211211
tar -czf ${pkg_outdir}/${tarball_name} ${tarball_root_dir} >> ${pkg_log} 2>&1
212212
popd >> ${pkg_log} 2>&1
213-
213+
214214
echo ${pkg_label} "Release tarball created: ${pkg_outdir}/${tarball_name}"
215-
215+
216216
# Add tarball temporary directory to cleanup
217217
pkg_cleanup="${pkg_cleanup} ${tarball_tmp}"
218-
218+
219219
fi
220220

221221
if [ "$rc" -eq 0 ]; then

contrib/jenkins_tests/rpm.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,14 @@ if [ $opt_binrpm -eq 1 ]; then
7676
if [ $opt_rpm -eq 1 ]; then
7777
test_exec="env RPM_BUILD_NCPUS=${NPROC} rpmbuild -bb --define='configure_options $jenkins_test_custom_configure' $rpmmacros $rpmopts $rpmspec"
7878
else
79-
test_exec="env configure_options=\"$jenkins_test_custom_configure\" dpkg-buildpackage -us -uc -b"
79+
test_exec="env make_opt=\"${make_opt}\" configure_options=\"$jenkins_test_custom_configure\" dpkg-buildpackage -us -uc -b"
8080
fi
8181
do_check_result "$test_exec" "$test_id" "binrpm" "$rpm_tap" "${rpm_dir}/rpm-${test_id}"
8282
test_id=$((test_id+1))
8383
fi
8484

8585
if [ $opt_checkpkg -eq 1 ]; then
86-
test_exec="env RPM_BUILD_NCPUS=${NPROC} PRJ_RELEASE=1 ${WORKSPACE}/contrib/build_pkg.sh -b -s -a \"configure_options=$jenkins_test_custom_configure\" -i ${WORKSPACE} -o ${rpm_dir}/dist-pkg"
86+
test_exec="env RPM_BUILD_NCPUS=${NPROC} make_opt=\"${make_opt}\" PRJ_RELEASE=1 ${WORKSPACE}/contrib/build_pkg.sh -b -s -a \"configure_options=$jenkins_test_custom_configure\" -i ${WORKSPACE} -o ${rpm_dir}/dist-pkg"
8787
do_check_result "$test_exec" "$test_id" "checkpkg" "$rpm_tap" "${rpm_dir}/rpm-${test_id}"
8888
do_archive "${rpm_dir}/dist-pkg/build_pkg.log"
8989
test_id=$((test_id+1))

debian/rules

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,18 @@ build-debug:
1616
./configure --with-ofed=/usr --prefix=/usr \
1717
--libdir=/usr/lib --includedir=/usr/include --sysconfdir=/etc \
1818
--enable-opt-log=none --enable-debug ${configure_options}
19-
make
19+
make ${make_opt}
2020
cp -f src/core/.libs/libxlio.so libxlio-debug.so
2121
make clean
2222

2323

2424
# Commands not to run
2525
override_dh_auto_configure:
2626

27+
# Use parallel build for production build
28+
override_dh_auto_build:
29+
dh_auto_build -- ${make_opt}
30+
2731
# Workaround for missing dependency information in libmongoclient package
2832
override_dh_shlibdeps:
2933
dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info

0 commit comments

Comments
 (0)