From owner-cvs-src@FreeBSD.ORG Mon May 21 11:34:22 2007 Return-Path: X-Original-To: cvs-src@freebsd.org Delivered-To: cvs-src@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1590716A41F; Mon, 21 May 2007 11:34:22 +0000 (UTC) (envelope-from ru@rambler-co.ru) Received: from relay0.rambler.ru (relay0.rambler.ru [81.19.66.187]) by mx1.freebsd.org (Postfix) with ESMTP id 7AACD13C45B; Mon, 21 May 2007 11:34:21 +0000 (UTC) (envelope-from ru@rambler-co.ru) Received: from relay0.rambler.ru (localhost [127.0.0.1]) by relay0.rambler.ru (Postfix) with ESMTP id 3ABCA5D84; Mon, 21 May 2007 15:34:20 +0400 (MSD) Received: from edoofus.park.rambler.ru (unknown [81.19.65.108]) by relay0.rambler.ru (Postfix) with ESMTP id 17A975D65; Mon, 21 May 2007 15:34:20 +0400 (MSD) Received: (from ru@localhost) by edoofus.park.rambler.ru (8.13.8/8.13.8) id l4LBU12O063224; Mon, 21 May 2007 15:30:01 +0400 (MSD) (envelope-from ru) Date: Mon, 21 May 2007 15:30:01 +0400 From: Ruslan Ermilov To: Garance A Drosehn Message-ID: <20070521113001.GC87534@rambler-co.ru> References: <200705190756.l4J7u9wP058382@repoman.freebsd.org> <20070519085103.GA61276@rambler-co.ru> <20070519105804.6b6cae10@kan.dnsalias.net> <20070520062748.GA54935@rambler-co.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ABTtc+pdwF7KHXCz" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.15 (2007-04-06) X-Virus-Scanned: No virus found Cc: cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/gnu/usr.bin/cc/cc_tools Makefile X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2007 11:34:22 -0000 --ABTtc+pdwF7KHXCz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, May 20, 2007 at 07:08:37PM -0400, Garance A Drosehn wrote: > At 10:27 AM +0400 5/20/07, Ruslan Ermilov wrote: > > > > It sometimes happens when the date/time are not being set > > properly, so that the tools are mistakenly rebuilt again > > at an inappropriate time when in the foreign environment > > of the target -- the problem is usually understood better > > when building for another CPU architecture and hitting it. > > I think this was an inappropriate commit to make, unless > > the problem can be reproduced. I have upgraded several > > i386's and amd64's without a problem. >=20 > Is there any way we could detect the clock-skew problem? This keeps > coming up, year-after-year, for many different people, including > very experienced developers. And when it does come up, it is > either: (1) totally safe, and thus unnoticed, or (2) screws up > someone in the middle of some major upgrade, thus causing great > angst and gnashing of teeth. >=20 > It would be nice if we could come up with a reliable check for the > problem. >=20 This came up before, and I have a rudimentary patch for this that should cover most of the cases, leaving a backdoor for shooting in the foot, but i'm uncertain about how to properly address the local/remote date/time mismatch issues I mention here. For example, with the below check added, if you "cvs update" your src/ from a remote repo, and your machine is lagging time by one minute, you'll end up with a file whose modification time is set to the future time, from your machine clock's POV. Also, the one-second granularity could sometimes be annoying. On Thu, Dec 01, 2005 at 08:47:03PM +0200, Ruslan Ermilov wrote: > I considered doing this in make(1) a while ago, but have come > to a conclusion it's not quite safe. For example, I often > "cvs update" from remote repositories, and that sets modification > time to that of the repository machine (probably only if it's a > new file, I don't recall all the conditions now, or it might > have been NFS-mounted src/ or repo). >=20 > This has the granularity of one second, i.e., "touch Makefile; > make -n all" will falsely trigger the check: >=20 > %%% > Index: Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > RCS file: /home/ncvs/src/Makefile,v > retrieving revision 1.325 > diff -u -r1.325 Makefile > --- Makefile 28 Nov 2005 11:14:36 -0000 1.325 > +++ Makefile 1 Dec 2005 18:43:12 -0000 > @@ -159,6 +159,10 @@ > .MAIN: all > =20 > STARTTIME!=3D LC_ALL=3DC date > +CHECK_TIME!=3D find ${.CURDIR}/Makefile -mtime -0 > +.if ${CHECK_TIME} =3D=3D "${.CURDIR}/Makefile" > +.error check your date/time: ${STARTTIME} > +.endif > =20 > .if defined(HISTORICAL_MAKE_WORLD) || defined(DESTDIR) > # > %%% Cheers, --=20 Ruslan Ermilov ru@FreeBSD.org FreeBSD committer --ABTtc+pdwF7KHXCz Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.3 (FreeBSD) iD8DBQFGUYK5qRfpzJluFF4RApGYAJ43uf/iYpsvCuDJrNYHs7qmvT2mOQCeNtB3 im1xaMCLPplRrj7sMD6Aw2I= =fm3S -----END PGP SIGNATURE----- --ABTtc+pdwF7KHXCz--