Skip to content

Commit

Permalink
c-kernel: avoid unnecessary rebuilds due to __pycache__ directories
Browse files Browse the repository at this point in the history
Previously, we would rebuild the kernel if any file in the `seL4`
repository changed since previous `cmake` setup. Since the kernel build
after the `cmake` setup generates `__pycache__` directories in the
`seL4` tree, this would cause some unnecessary rebuilds.

This commit explicitly excludes `__pycache__` directories from the set
of files considered to be dependencies of the kernel build.

Signed-off-by: Matthew Brecknell <[email protected]>
  • Loading branch information
mbrcknl committed Apr 17, 2020
1 parent 18c9f36 commit d8364c9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion spec/cspec/c/kernel.mk
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ ifndef ISABELLE_PROCESS
export ISABELLE_PROCESS:=${ISABELLE_HOME}/bin/isabelle-process
endif

KERNEL_DEPS := $(shell find ${SOURCE_ROOT} -type f)
# __pycache__ directories are the only in-tree products of the kernel build.
# But since they are generated after the cmake setup, they would cause unnecessary
# kernel rebuilds if we treated them as dependencies of the kernel build.
# We avoid this by excluding __pycache__ directories from the kernel dependencies.
KERNEL_DEPS := $(shell find ${SOURCE_ROOT} -name __pycache__ -prune -o -type f -print)

# Top level rule for rebuilding kernel_all.c_pp
${KERNEL_BUILD_ROOT}/kernel_all.c_pp: ${KERNEL_BUILD_ROOT}/.cmake_done
Expand Down

0 comments on commit d8364c9

Please sign in to comment.