From 9ca56c45850709473f60bf5de71008a747d4e27b Mon Sep 17 00:00:00 2001 From: Jeffrey Griffin Date: Sat, 4 Mar 2017 22:35:18 -0800 Subject: fix removing deps.log at toplevel when in a multi-app layout `rm deps.log` was not being executed, because of 1) the ifeq around it, checking for an empty ALL_DEPS_DIRS, which i believe was a logical error; and 2) deps depended on apps, which means apps were compiled before its recipe was executed, and the `rm deps.log` would be executed after it had been written to by recursive make of the apps. the important reason to remove deps.log is so that dependencies get remade when they change. otherwise you'll get mysterious errors about missing dependencies if they need to be rebuilt, or worse, have wrong stale beam files bundled in your release. tests core-deps-apps and core-deps-apps-only now manually clean the cowlib dep and rebuild at the top-level to make sure cowlib gets rebuilt. both tests indeed fail without this fix. this attempts to fix #1 by removing the ifeq, and #2 by having deps and apps depend on deps.log, with deps.log 'built' (but actually removed) by a double-colon rule with no prerequisites (which means its recipe always be run). --- test/core_deps.mk | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/core_deps.mk b/test/core_deps.mk index 174147b..14def21 100644 --- a/test/core_deps.mk +++ b/test/core_deps.mk @@ -33,7 +33,7 @@ core-deps-apps: build clean $t test -f $(APP)/apps/my_app/ebin/my_app.app $t test -f $(APP)/apps/my_app/ebin/boy.beam $t test -f $(APP)/apps/my_app/ebin/girl.beam - $t test -d $(APP)/deps/cowlib + $t test -f $(APP)/deps/cowlib/ebin/cowlib.app # Applications in apps are compiled automatically but not added # to the application resource file unless they are listed in LOCAL_DEPS. @@ -49,6 +49,18 @@ core-deps-apps: build clean [{module, M} = code:load_file(M) || M <- Mods], \ halt()" + $i "Clean Cowlib" + $t $(MAKE) -C $(APP)/deps/cowlib clean $v + + $i "Check that Cowlib compiled files were removed" + $t test ! -e $(APP)/deps/cowlib/ebin/cowlib.app + + $i "Build the application again" + $t $(MAKE) -C $(APP) $v + + $i "Check that Cowlib compiled files exist" + $t test -f $(APP)/deps/cowlib/ebin/cowlib.app + $i "Clean the application" $t $(MAKE) -C $(APP) clean $v @@ -427,7 +439,7 @@ core-deps-apps-only: build clean $t test -f $(APP)/apps/my_app/ebin/my_app_app.beam $t test -f $(APP)/apps/my_app/ebin/my_app_sup.beam $t test -f $(APP)/apps/my_app/ebin/my_server.beam - $t test -d $(APP)/deps/cowlib/ + $t test -f $(APP)/deps/cowlib/ebin/cowlib.app $i "Check that the application was compiled correctly" $t $(ERL) -pa $(APP)/apps/*/ebin/ -eval " \ @@ -436,6 +448,18 @@ core-deps-apps-only: build clean [{module, M} = code:load_file(M) || M <- Mods], \ halt()" + $i "Clean Cowlib" + $t $(MAKE) -C $(APP)/deps/cowlib clean $v + + $i "Check that Cowlib compiled files were removed" + $t test ! -e $(APP)/deps/cowlib/ebin/cowlib.app + + $i "Build the application again" + $t $(MAKE) -C $(APP) $v + + $i "Check that Cowlib compiled files exist" + $t test -f $(APP)/deps/cowlib/ebin/cowlib.app + $i "Clean the application" $t $(MAKE) -C $(APP) clean $v -- cgit v1.2.3