Skip to content

Commit

Permalink
Fix regression of mktree not always rebuilding
Browse files Browse the repository at this point in the history
Commit d4e808e added cmake caching for
mktree so that we don't rebuild the tree on each "make check"
invocation.  However, this means we can now easily miss some test
dependencies being updated since we don't depend on everything, e.g. the
data/ dir.

To fix this, instead of adding each and every file and directory as a
dependency of the mktree.output command, just rebuild the tree every
time.  The base image (made with DNF) is already cached anyway, and the
added overhead is tiny and outweighs the (potential) engineering hours
lost due to this.

The funny thing is, this was already fixed once in 2019:
fc05045

Sometimes you've just gotta fix stuff twice before it sticks!

Fixes: #2725
  • Loading branch information
dmnks authored and pmatilai committed Oct 17, 2023
1 parent fa81820 commit 12b073b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
13 changes: 4 additions & 9 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ add_custom_target(reset
)

add_custom_target(tree
DEPENDS mktree.output
COMMAND ./mktree build
DEPENDS rpmtests
DEPENDS ${TESTPROGS}
DEPENDS ${TOOLPROGS}
)

add_custom_command(OUTPUT rpmtests
Expand All @@ -140,11 +143,3 @@ add_custom_command(OUTPUT rpmtests
DEPENDS ${TESTSUITE_AT}
DEPENDS local.at
)

add_custom_command(OUTPUT mktree.output
COMMAND ./mktree build
DEPENDS rpmtests
DEPENDS ${TESTPROGS}
DEPENDS ${TOOLPROGS}
DEPENDS mktree
)
3 changes: 0 additions & 3 deletions tests/mktree.fedora
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,6 @@ case $CMD in
# Add RPM installation layer
rm -rf "$INST_DIR"
make_install $INST_DIR

# Signal change to build system
touch mktree.output
;;
atshell)
set -a
Expand Down

0 comments on commit 12b073b

Please sign in to comment.