fun with makefiles tonight

I've been tracking down a build issue that just started happening today on the OSX build server and the error seems to be not related to any source that was checked in today, but rather with something in the environment that may have been lurking for a couple days now just waiting for the right time to pounce! The sympton is that during a "release" build (DEBUG=0) the python build would fail during the ./configure step with this error: bq. checking for getaddrinfo... yes checking getaddrinfo bug... buggy Fatal: You must get working getaddrinfo() function. Now most normal people would figure that something was up with python or ipv6 or the normal culprits but when you look at the config.log output for the debug build, this check is exactly the same. One of the OSAF devs (thanks Grant B.) even generated a test binary for me to run and it returned with no errors. Great. To make matters worse, the scripts that run the tinderbox immediately clean the environment if a build fails so I had to resort to local hacks to get the log outputs. After running down a couple dead-ends, more than I care to admit right now, I was finally able to get a command sequence that would reproduce it from the command line so I wasn't tied to running hacked scripts. Basically if I ran "make DEBUG=0 realclean all" it would fail, but if I ran "make DEBUG=0 realclean world" it worked. Hmmmmmm Looking at the Makefile revealed a couple key difference between the two options and checking the tinderbox scripts revealed that they used the "all" method whereas the wiki page touted the "world" option. Here is the segment of the Makefile showing both targets: bq. .PHONY: sources expand binaries $(SYSTEMS) env:: mkdir -p $(PREFIX)/bin $(PREFIX)/lib $(PREFIX)/include sources: env for system in $(SYSTEMS); \ do \ $(MAKE) -C $$system sources; \ done $(SYSTEMS): $(MAKE) -C $@ DEBUG=$(DEBUG) all: env sources $(SYSTEMS) world: all binaries install make -C ../internal DEBUG=$(DEBUG) world After going back and refreshing my understanding of the "::" "Double Colon Rules":http://www.gnu.org/software/make/manual/htmlchapter/make4.html#SEC50 I saw that according to the manual you cannot have the double-colon item, "env" in our case, that all rules that have "env" must also be double-colon rules. Well, that's how I'm reading it - let me know if that's wrong. Going with that thought I made a simple change to the Makefile and re-ran the tests: bq. all: source $(SYSTEMS) and my testing worked and as I type this the full OSX tinderbuild is in progress and hopefully it will work there or it's back looking for another issue :( I'll update the journal later with the results - I'm off to bed.


Mentions