Date: Wed, 17 May 2006 15:53:09 +0300 From: Vasil Dimov <vd@FreeBSD.org> To: Wesley Shields <wxs@atarininja.org> Cc: ports@freebsd.org, Edwin Groothuis <edwin@mavetju.org>, Paul Koch <paul.koch@statseeker.com> Subject: Re: Is it safe to compile multiple ports at the same time ? Message-ID: <20060517125309.GA1265@qlovarnika.bg.datamax> In-Reply-To: <20060517133944.GA39615@atarininja.org> References: <200605171353.37745.paul.koch@statseeker.com> <20060517045403.GI1113@k7.mavetju> <200605171508.07228.paul.koch@statseeker.com> <20060517060026.GA40653@qlovarnika.bg.datamax> <20060517061302.GR1116@k7.mavetju> <20060517121337.GA50791@iib.unsam.edu.ar> <20060517133944.GA39615@atarininja.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--45Z9DzgjV8m4Oswq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 17, 2006 at 08:39:44AM -0500, Wesley Shields wrote: > On Wed, May 17, 2006 at 09:13:37AM -0300, Fernan Aguero wrote: > > +----[ Edwin Groothuis <edwin@mavetju.org> (17.May.2006 03:16): > > | > > | You have to obtain a lock on the X's Makefile before you are doing > > | to check if you have this port installed. > > |=20 > > | For example, a dependcy on pkg-config in the directory devel/pkgconfi= g: > > |=20 > > | - obtain lock on devel/pkgconfig/Makefile > > | - check if pkg-config exists, and if not, build and install it. > > | - release lock on devel/pkgconfig/Makefile > > |=20 > > | > > +----] > >=20 > > Why not > >=20 > > - check if pkg-config exists and only if it doesn't exist, > > try to obtain lock on the lock target. >=20 > Because at that point aren't you in a race condition? >=20 > Port A finds out pkg-config doesn't exist. > Port B finds out pkg-config doesn't exist. >=20 > At this point both ports determine they need to build and install the > port. >=20 > Port B manages to obtain the lock first, and builds and installs > pkgconfig. > Port A waits on Port B to finish. > Upon finishing Port A obtains the lock and builds and attempts to > install an already installed port. >=20 > You must obtain the lock early on, like Edwin has stated. >=20 Maybe he meant - check if pkg-config exists and only if it doesn't exist, try to obtain lock on the lock target. - check if pkg-config exists, and if not, build and install it. - release lock on devel/pkgconfig/Makefile this will eventually save unnecessary locking with the cost of checking twice if the port is installed. --=20 Vasil Dimov gro.DSBeerF@dv Testing can show the presence of bugs, but not their absence. -- Edsger W. Dijkstra --45Z9DzgjV8m4Oswq Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- iD8DBQFEaxy1Fw6SP/bBpCARAq+pAJ0SnFCFv0W7g5w+2nYh+5jV8wx19gCg2I3T Bgd6YWsBKUccC1FJxdg4uVo= =+Yh/ -----END PGP SIGNATURE----- --45Z9DzgjV8m4Oswq--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060517125309.GA1265>