From: Jonathan Nieder <hidden> Date: 2016-06-15 22:49:16
From a local run of “make CHECK_HEADER_DEPENDENCIES=1”.
Jonathan Nieder (2):
Makefile: add missing dependencies on url.h
Makefile: add missing dependency on http.h
Makefile | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
From: Jonathan Nieder <hidden> Date: 2016-06-15 22:49:16
v1.7.2-rc0~56^2 and its parent (decode file:// and ssh://
URLs, 2010-05-23) introduced a new url library. Update the
Makefile with the relevant dependencies.
Detected with "make CHECK_HEADER_DEPENDENCIES=1".
Cc: Jeff King <redacted>
Signed-off-by: Jonathan Nieder <redacted>
---
Makefile | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
From: Jonathan Nieder <hidden> Date: 2016-06-15 22:49:16
v1.7.1-rc0~65^2~2 (http: init and cleanup separately from
http-walker, 2010-03-02) introduced a direct dependency from
http-fetch on the HTTP request library. Declare it.
Detected with "make CHECK_HEADER_DEPENDENCIES=1".
Cc: Tay Ray Chuan <redacted>
Signed-off-by: Jonathan Nieder <redacted>
---
After this series, “make COMPUTE_HEADER_DEPENDENCIES=YesPlease”
succeeds again.
Ideas for future work:
- speed up the dependency checker, run it regularly;
- port COMPUTE_HEADER_DEPENDENCIES to non-gcc compilers so it can
be used by default;
- speed up the redundant-dependency detector[1] enough to make it
usable;
- autoconf test;
- “make test-makefile” for cron jobs.
Alas, this series did none of those things.
[1] [off-list ref] which doesn’t seem to
have made it out into the world. Will resend as reply.
Makefile | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
From: Jonathan Nieder <hidden> Date: 2016-06-15 22:49:16
When the CHECK_HEADER_DEPENDENCIES facility is turned on, report
files in three categories:
a. detected dependencies missing from the hard-coded dependencies
b. hard-coded dependencies that were neither detected nor in
$(LIB_H)
c. duplicate hard-coded dependencies
Unfortunately, due to my ignorance of GNU make syntax, a and b
each read the detected dependencies from disk independently,
so this is very slow when using an old laptop drive.
Stale dependency rules can easily accumulate unnoticed, so
despite the slowdown, this should be a useful automated check.
The unnecessary dependencies (b) do not include files from
$(LIB_H) to avoid noise from the $(GIT_OBJS): $(LIB_H) rule,
which avoids patch noise adjusting dependencies as files start to
use different parts of libgit.
Signed-off-by: Jonathan Nieder <redacted>
---
Junio C Hamano wrote:
Jonathan Nieder [off-list ref] writes:
quoted
That would not be hard to do, but wouldn’t the $(GIT_OBJS): $(LIB_H)
rule create a lot of noise?
How about if it checks for duplicate dependencies and unnecessary
dependencies that are not in LIB_H?
That would be ideal, I think.
Here is a mockup for that. I still have to speed this up before I
find it bearable to use. Currently this forks submakes twice to read
in the same computed list of dependencies, but this should be
avoidable (maybe using $(call ...)?).
Makefile | 53 ++++++++++++++++++++++++++++++++++++-----------------
1 files changed, 36 insertions(+), 17 deletions(-)
@@ -1718,11 +1718,42 @@ endififdef CHECK_HEADER_DEPENDENCIESifndef PRINT_HEADER_DEPENDENCIES-missing_deps=$(filter-out$(notdir$^),\-$(notdir$(shell$(MAKE)-s$@\+dep=$(notdir$^)+all_dep=$(notdir$+)+computed_dep=$(notdir$(shell$(MAKE)-s$@\CHECK_HEADER_DEPENDENCIES=YesPlease\USE_COMPUTED_HEADER_DEPENDENCIES=YesPlease\-PRINT_HEADER_DEPENDENCIES=YesPlease)))+PRINT_HEADER_DEPENDENCIES=YesPlease))++missing_dep=$(filter-out$(dep),$(computed_dep))++sloppy_dep:=$(notdir$(LIB_H))$(notdir$(dep_files))+extra_dep=$(filter-out$(sloppy_dep)$(computed_dep),$(dep))++nondup_dep=$(foreachf,$(dep),\+$(word$(words$(filter$f,$(all_dep))),$f))+# If the list of dependencies including duplicates has the same size+# as the list without, there are no dups.+dup_dep=$(if$(filter$(words$^),$(words$+)),,\+$(filter-out$(nondup_dep),$(dep)))++cmd_check_deps=@set-e;echoCHECK$@;\+missing_dep="$(missing_dep)";\+extra_dep="$(extra_dep)";\+dup_dep="$(dup_dep)";\+ if test "$$missing_dep"; \+then\+echomissingdependencies:$$missing_dep;\+fi;\+ if test "$$extra_dep"; \+then\+echounnecessarydependencies:$$extra_dep;\+fi;\+ if test "$$dup_dep"; \+then\+echoduplicatedependencies:$$dup_dep;\+fi;\+test-z"$$missing_dep$$extra_dep$$dup_dep"endifendif
@@ -1747,21 +1778,9 @@ endififndef PRINT_HEADER_DEPENDENCIESifdef CHECK_HEADER_DEPENDENCIES$(C_OBJ):%.o: %.c$(dep_files)FORCE-@set-e;echoCHECK$@;\-missing_deps="$(missing_deps)";\- if test "$$missing_deps"; \-then\-echomissingdependencies:$$missing_deps;\-false;\-fi+$(cmd_check_deps)$(ASM_OBJ):%.o: %.S$(dep_files)FORCE-@set-e;echoCHECK$@;\-missing_deps="$(missing_deps)";\- if test "$$missing_deps"; \-then\-echomissingdependencies:$$missing_deps;\-false;\-fi+$(cmd_check_deps)endifendif
From: Jeff King <hidden> Date: 2016-06-15 22:49:16
On Sun, Aug 08, 2010 at 04:25:11PM -0500, Jonathan Nieder wrote:
v1.7.2-rc0~56^2 and its parent (decode file:// and ssh://
URLs, 2010-05-23) introduced a new url library. Update the
Makefile with the relevant dependencies.
Detected with "make CHECK_HEADER_DEPENDENCIES=1".
From: Tay Ray Chuan <hidden> Date: 2016-06-15 22:49:16
Hi,
On Mon, Aug 9, 2010 at 5:48 AM, Jonathan Nieder [off-list ref] wrote:
v1.7.1-rc0~65^2~2 (http: init and cleanup separately from
http-walker, 2010-03-02) introduced a direct dependency from
http-fetch on the HTTP request library. Declare it.
Detected with "make CHECK_HEADER_DEPENDENCIES=1".
Cc: Tay Ray Chuan <redacted>
Signed-off-by: Jonathan Nieder <redacted>
Whoops - thanks for catching this.
Acked-by: Tay Ray Chuan [off-list ref]
--
Cheers,
Ray Chuan