Build avoidance fixes

1) Build avoidance fails on a clean workspace because directory
$MY_WORKSPACE/tmp doesn't exist when mktemp needs to
create a forth subdir under that path.

Add a 'mkdir -p $MY_WORKSPACE/tmp' to ensure it exists
prior to mktemp.

2) Failed to rebuild kmods after a kernel change and
building with build-avoidance enabled.  The problem was
a missing dependency cache that would have listed
the kmods as having dependencies on the kernel.
Reusing kmods from a prior build in conjunction with
a rebuilt kernel results int load with unusable kmods
due to a key mismatch.

Add the dependancy-cache to the list of artifacts to
syncronize as part of build avoidance.  A primed
dependency cache will allow build-pkgs to determine
that kmods must be rebuilt when the kernel has changed.

3) Make sure $MY_WORKSPACE/$BUILD_TYPE/repo
symlink exists after a build avoidance build.
If no packages require a rebuild, it was missing.

4) Fix an error message that was puzzling while debugging
the above issues.

Closes-Bug: 1864110
Change-Id: Ia912b2e3e110efbe69004d7978109ebb089d684b
Signed-off-by: Scott Little <scott.little@windriver.com>
This commit is contained in:
Scott Little 2019-10-28 19:22:57 -04:00
parent fe04871f95
commit 9b77e2e1b3
5 changed files with 24 additions and 2 deletions

View File

@ -10,7 +10,7 @@
#
BUILD_AVOIDANCE_SRPM_DIRECTORIES="inputs srpm_assemble rpmbuild/SRPMS rpmbuild/SOURCES"
BUILD_AVOIDANCE_SRPM_FILES=""
BUILD_AVOIDANCE_RPM_DIRECTORIES="results rpmbuild/RPMS rpmbuild/SPECS"
BUILD_AVOIDANCE_RPM_DIRECTORIES="results rpmbuild/RPMS rpmbuild/SPECS repo/cgcs-tis-repo/dependancy-cache"
BUILD_AVOIDANCE_RPM_FILES=".platform_release"

View File

@ -35,6 +35,10 @@
# BUILD_AVOIDANCE_FILE_TRANSFER="my-supported-prototcol"
#
BUILD_AVOIDANCE_UTILS_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}" )" )"
source "${BUILD_AVOIDANCE_UTILS_DIR}/git-utils.sh"
BUILD_AVOIDANCE_USR=""
BUILD_AVOIDANCE_HOST=""
BUILD_AVOIDANCE_DIR=""
@ -778,6 +782,22 @@ build_avoidance () {
return 1
fi
if [ ! -d $MY_WORKSPACE/$BUILD_TYPE ]; then
mkdir -p $MY_WORKSPACE/$BUILD_TYPE
if [ $? -ne 0 ]; then
>&2 echo "Error: $FUNCNAME (${LINENO}): Failed to create directory $MY_WORKSPACE/$BUILD_TYPE"
return 1
fi
fi
if [ ! -L $MY_WORKSPACE/$BUILD_TYPE ]; then
ln -s $MY_REPO $MY_WORKSPACE/$BUILD_TYPE/repo
if [ $? -ne 0 ]; then
>&2 echo "Error: $FUNCNAME (${LINENO}): Failed to create symlink $MY_WORKSPACE/$BUILD_TYPE/repo -> $MY_REPO"
return 1
fi
fi
build_avoidance_pre_clean $BUILD_TYPE
if [ $? -ne 0 ]; then
>&2 echo "Error: $FUNCNAME (${LINENO}): build_avoidance_pre_clean $BUILD_TYPE"

View File

@ -1838,6 +1838,7 @@ update_spec_cache () {
echo "Find the list of packages we must compile"
mkdir -p $MY_WORKSPACE/tmp/
NEED_BUILD_DIR=$(mktemp -d $MY_WORKSPACE/tmp/$USER-$ME-need-build-XXXXXX)
if [ $? -ne 0 ] || [ "x$NEED_BUILD_DIR" == "x" ]; then
echo "Failed to create temp directory under $MY_WORKSPACE/tmp"

View File

@ -1598,6 +1598,7 @@ update_spec_cache () {
echo "Find the list of packages we must compile"
mkdir -p $MY_WORKSPACE/tmp/
NEED_BUILD_DIR=$(mktemp -d $MY_WORKSPACE/tmp/$USER-$ME-need-build-XXXXXX)
if [ $? -ne 0 ] || [ "x$NEED_BUILD_DIR" == "x" ]; then
echo "Failed to create temp directory under $MY_WORKSPACE/tmp"

View File

@ -119,7 +119,7 @@ md5sums_from_input_vars () {
if [ "x$COPY_LIST" != "x" ]; then
ABS_COPY_LIST=$(readlink -f $COPY_LIST)
if [ $? -ne 0 ]; then
>&2 echo "ERROR: $FUNCNAME (${LINENO}): readlink -f '$COPY_LIST' -type f"
>&2 echo "ERROR: $FUNCNAME (${LINENO}): readlink -f '$COPY_LIST'"
return 1
fi