Skip to content

Commit 937f7cb

Browse files
author
Richard Top
committed
Merge branch '2023.06-software.eessi.io' of gh-nessi:EESSI/software-layer into eessi-2023.06-Wayland/1.22.0-GCCcore/13.2.0
2 parents e9bb5b8 + ae65221 commit 937f7cb

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

EESSI-install-software.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,15 @@ ${EESSI_PREFIX}/scripts/gpu_support/nvidia/install_cuda_host_injections.sh -c 12
204204

205205
# use PR patch file to determine in which easystack files stuff was added
206206
changed_easystacks=$(cat ${pr_diff} | grep '^+++' | cut -f2 -d' ' | sed 's@^[a-z]/@@g' | grep '^easystacks/.*yml$' | egrep -v 'known-issues|missing')
207-
if [ -z ${changed_easystacks} ]; then
207+
if [ -z "${changed_easystacks}" ]; then
208208
echo "No missing installations, party time!" # Ensure the bot report success, as there was nothing to be build here
209209
else
210210

211-
for easystack_file in ${changed_easystacks}; do
211+
# first process rebuilds, if any, then easystack files for new installations
212+
# "|| true" is used to make sure that the grep command always returns success
213+
rebuild_easystacks=$(echo "${changed_easystacks}" | (grep "/rebuilds/" || true))
214+
new_easystacks=$(echo "${changed_easystacks}" | (grep -v "/rebuilds/" || true))
215+
for easystack_file in ${rebuild_easystacks} ${new_easystacks}; do
212216

213217
echo -e "Processing easystack file ${easystack_file}...\n\n"
214218

bot/build.sh

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,10 @@ fi
182182
# determine if the removal step has to be run
183183
# assume there's only one diff file that corresponds to the PR patch file
184184
pr_diff=$(ls [0-9]*.diff | head -1)
185-
changed_easystacks_rebuilds=$(cat ${pr_diff} | grep '^+++' | cut -f2 -d' ' | sed 's@^[a-z]/@@g' | grep '^easystacks/.*yml$' | grep "/rebuilds/")
186-
if [[ -z ${changed_easystacks_rebuilds} ]]; then
185+
# the true at the end of the next command is important: grep will expectedly return 1 if there is no easystack file being added under rebuilds,
186+
# but due to "set -e" the entire script would otherwise fail
187+
changed_easystacks_rebuilds=$(cat ${pr_diff} | grep '^+++' | cut -f2 -d' ' | sed 's@^[a-z]/@@g' | grep '^easystacks/.*yml$' | (grep "/rebuilds/" || true))
188+
if [[ -z "${changed_easystacks_rebuilds}" ]]; then
187189
echo "This PR does not add any easystack files in a rebuilds subdirectory, so let's skip the removal step."
188190
else
189191
# prepare directory to store tarball of tmp for removal and build steps
@@ -192,7 +194,7 @@ else
192194

193195
# prepare arguments to eessi_container.sh specific to remove step
194196
declare -a REMOVAL_STEP_ARGS=()
195-
REMOVAL_STEP_ARGS+=("--save" "${TARBALL_TMP_BUILD_STEP_DIR}")
197+
REMOVAL_STEP_ARGS+=("--save" "${TARBALL_TMP_REMOVAL_STEP_DIR}")
196198
REMOVAL_STEP_ARGS+=("--storage" "${STORAGE}")
197199
# add fakeroot option in order to be able to remove software, see:
198200
# https://github.com/EESSI/software-layer/issues/312
@@ -247,7 +249,14 @@ declare -a TARBALL_STEP_ARGS=()
247249
TARBALL_STEP_ARGS+=("--save" "${TARBALL_TMP_TARBALL_STEP_DIR}")
248250

249251
# determine temporary directory to resume from
250-
TARBALL_STEP_ARGS+=("--resume" "${REMOVAL_TMPDIR}")
252+
if [[ -z ${REMOVAL_TMPDIR} ]]; then
253+
# no rebuild step was done, so the tarball step should resume from the build directory
254+
BUILD_TMPDIR=$(grep ' as tmp directory ' ${build_outerr} | cut -d ' ' -f 2)
255+
TARBALL_STEP_ARGS+=("--resume" "${BUILD_TMPDIR}")
256+
else
257+
# a removal step was done, so resume from its temporary directory (which was also used for the build step)
258+
TARBALL_STEP_ARGS+=("--resume" "${REMOVAL_TMPDIR}")
259+
fi
251260

252261
timestamp=$(date +%s)
253262
# to set EESSI_VERSION we need to source init/eessi_defaults now

0 commit comments

Comments
 (0)