threads / discuss / 7002

Broken dependencies..

Subject: Broken dependencies..

## tl;dr

4 messages between Feb 27, 2007 and Feb 28, 2007.

replies: 3people: 3as markdown or json

Linus Torvalds· Feb 27, 2007, 23:46 UTC · lore
Try this on the current git archive:
	git checkout master
	make clean
	make
	...
	git checkout next
	make
and at least I get 
	...
	gcc -g -O2 -Wall  -DSHA1_HEADER='<openssl/sha.h>' -DETC_GITCONFIG='"/home/torvalds/etc/gitconfig"' -DNO_STRLCPY -o git-local-fetch   local-fetch.o fetch.o libgit.a xdiff/lib.a -lz  -lcrypto
	fetch.o: In function `process_object':
	/home/torvalds/git/fetch.c:137: undefined reference to `type_names'
	fetch.o: In function `typename':
	/home/torvalds/git/object.h:46: undefined reference to `type_names'
	collect2: ld returned 1 exit status
apparently because fetch.c wasn't recompiled and it used the old fetch.o.

Ugh. I take full blame for the Makefile being a total mess, and us not doing proper dependencies, but I'm too lazy to fix it. Any ideas on how to generate real dependency data so that we don't have these kinds of things (I bet there are other files than just fetch.c that lack the full header file dependencies, this one just happened to trigger now)?

		Linus
Johannes Schindelin· Feb 27, 2007, 23:55 UTC · re: Linus Torvalds · lore

Re: Broken dependencies..

Hi,
On Tue, 27 Feb 2007, Linus Torvalds wrote:
> 	/home/torvalds/git/fetch.c:137: undefined reference to `type_names'
> 	fetch.o: In function `typename':
I realized that too, and forgot to send out the patch:

-- snip -- [PATCH] fetch.o depends on the headers, too.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---
 Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Makefile b/Makefile
index 20acc78..ce284fa 100644
--- a/Makefile
+++ b/Makefile
@@ -788,7 +788,7 @@ git-http-push$X: revision.o http.o http-push.o $(GITLIBS)
 	$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
 		$(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
 
-$(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H)
+$(LIB_OBJS) $(BUILTIN_OBJS) fetch.o: $(LIB_H)
 $(patsubst git-%$X,%.o,$(PROGRAMS)): $(LIB_H) $(wildcard */*.h)
 $(DIFF_OBJS): diffcore.h
 
-- snap --

Ciao,
Dscho
Andy Parkins· Feb 28, 2007, 09:00 UTC · re: Linus Torvalds · lore

Re: Broken dependencies..

On Tuesday 2007 February 27 23:46, Linus Torvalds wrote:
> doing proper dependencies, but I'm too lazy to fix it. Any ideas on how to
> generate real dependency data so that we don't have these kinds of things
> (I bet there are other files than just fetch.c that lack the full header
> file dependencies, this one just happened to trigger now)?

Would gcc's "-MM" help? I think qmake uses them when it's generating Makefiles.

Andy
-- 
Dr Andy Parkins, M Eng (hons), MIET
andyparkins@gmail.com
Johannes Schindelin· Feb 28, 2007, 15:00 UTC · re: Andy Parkins · lore

Re: Broken dependencies..

Hi,
On Wed, 28 Feb 2007, Andy Parkins wrote:
Show 9 quoted lines
> On Tuesday 2007 February 27 23:46, Linus Torvalds wrote:
> 
> > doing proper dependencies, but I'm too lazy to fix it. Any ideas on 
> > how to generate real dependency data so that we don't have these kinds 
> > of things (I bet there are other files than just fetch.c that lack the 
> > full header file dependencies, this one just happened to trigger now)?
> 
> Would gcc's "-MM" help?  I think qmake uses them when it's generating 
> Makefiles.

Would that play nicely with Sun' CC some people seem to use to compile Git?

Ciao, Dscho

← back to recent threads