[26856] in Source-Commits

home help back first fref pref prev next nref lref last post

Re: /svn/athena r25794 -

daemon@ATHENA.MIT.EDU (Benjamin Kaduk)
Thu Nov 1 12:00:12 2012

Date: Thu, 1 Nov 2012 12:00:03 -0400 (EDT)
From: Benjamin Kaduk <kaduk@MIT.EDU>
To: Jonathan D Reed <jdreed@MIT.EDU>
cc: source-commits@MIT.EDU
In-Reply-To: <201210312006.q9VK6jqJ002926@drugstore.mit.edu>
Message-ID: <alpine.GSO.1.10.1211011156380.2164@multics.mit.edu>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed

On Wed, 31 Oct 2012, Jonathan D Reed wrote:

> Author: jdreed
> Date: 2012-10-31 16:06:45 -0400 (Wed, 31 Oct 2012)
> New Revision: 25794
>
> Modified:
>   trunk/debathena/scripts/build-server/build-all/Makefile
> Log:
> - Pick a (slightly) less silly stamps directory (Trac: #727)
> - Ensure that we don't accidentally end up with parallel builds because of
>   stray .started or .error stamps (Trac: #1230)
>
>
> Modified: trunk/debathena/scripts/build-server/build-all/Makefile
> ===================================================================
> --- trunk/debathena/scripts/build-server/build-all/Makefile	2012-10-31 16:10:09 UTC (rev 25793)
> +++ trunk/debathena/scripts/build-server/build-all/Makefile	2012-10-31 20:06:45 UTC (rev 25794)
> @@ -1,6 +1,6 @@
> suite := quantal
> psuite := quantal
> -STAMPS := /afs/sipb.mit.edu/project/debathena/machines/awesome-build-server/stamps.$(suite)
> +STAMPS := /afs/sipb.mit.edu/project/debathena/arch/amd64_deb40/bin/build-server/build-all/stamps/stamps.$(suite)
>
> package = $(STAMPS)/$(1).done
>
> @@ -14,17 +14,22 @@
> 	:
>
> $(call package,%):
> -	file=$$(mktemp -t 'stupid.XXXXXX') && \
> +	@echo "Starting build of $*"
> +	@if [ -e $(STAMPS)/$*.started ]; then echo "Error, remove 'started' stamp and try again."; false; fi
> +	@rm -f $(STAMPS)/$*.error
> +	@file=$$(mktemp -t 'stupid.XXXXXX') && \
> 		echo "screen sh -c '$(CURDIR)/do-build $* $(STAMPS)/$* $(suite) $(psuite)'" > "$$file" && \
> 		echo "other" >> "$$file" && \
> 		screen -X source "$$file" && \
> 		sleep 2 && \
> 		rm -f "$$file"
> -	[ -e $(STAMPS)/$*.started ]
> -	while ! [ -e $(STAMPS)/$*.done ] && ! [ -e $(STAMPS)/$*.error ]; do sleep 1; done
> -	rm -f $(STAMPS)/$*.started
> -	rm -f $(STAMPS)/$*.error
> -	[ -e $(STAMPS)/$*.done ]
> +	@[ -e $(STAMPS)/$*.started ]

I suppose this would cause a very inscrutable error message if we had two 
build-alls racing against each other to start, but (1) that seems very 
unlikely and (2) a subsequent attempt would pick up the check above.
So, not worth worrying about (and ACK the whole thing.)

"So, when do we get a less-stupid tempfile name?"

-Ben

> +	@echo -n "Building $*..."
> +	@while ! [ -e $(STAMPS)/$*.done ] && ! [ -e $(STAMPS)/$*.error ]; do sleep 1; done
> +	@if [ -e $(STAMPS)/$*.done ]; then echo "OK"; else echo "FAILED"; fi
> +	@rm -f $(STAMPS)/$*.started
> +	@rm -f $(STAMPS)/$*.error
> +	@[ -e $(STAMPS)/$*.done ]
>
> clean:
> 	rm -f deps.mk $(STAMPS)/*.started $(STAMPS)/*.error
>
>

home help back first fref pref prev next nref lref last post