From owner-freebsd-hackers@FreeBSD.ORG Wed Jan 16 09:33:14 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD5CF16A418; Wed, 16 Jan 2008 09:33:14 +0000 (UTC) (envelope-from lulf@stud.ntnu.no) Received: from bene2.itea.ntnu.no (bene2.itea.ntnu.no [IPv6:2001:700:300:3::57]) by mx1.freebsd.org (Postfix) with ESMTP id C209713C502; Wed, 16 Jan 2008 09:33:12 +0000 (UTC) (envelope-from lulf@stud.ntnu.no) Received: from localhost (localhost [127.0.0.1]) by bene2.itea.ntnu.no (Postfix) with ESMTP id EDBA3160654; Wed, 16 Jan 2008 10:33:10 +0100 (CET) Received: from carrot.studby.ntnu.no (caracal.stud.ntnu.no [129.241.56.185]) by bene2.itea.ntnu.no (Postfix) with ESMTP id B84FD90002; Wed, 16 Jan 2008 10:33:03 +0100 (CET) Date: Wed, 16 Jan 2008 10:33:02 +0100 From: Ulf Lilleengen To: freebsd-hackers@freebsd.org Message-ID: <20080116093302.GA13632@carrot.studby.ntnu.no> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.17 (2007-11-01) X-Virus-Scanned: Debian amavisd-new at bene2.itea.ntnu.no Cc: Subject: Csup cvsmode build discussion X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jan 2008 09:33:14 -0000 Hello hackers, As some might know, I've been implementing CVSMode for csup over the last couple of months. Right now, I'm quite close to have it work (does not mean it will work perfect :)), but I encountered some issues regarding the inclusion of my lex and yacc files that I would like to discuss. It is assumed that the reader know what lex and yacc is. First of all, I implemented the RCS parser required to operate on RCS files using lex and yacc. Those are in FreeBSD userland, but the problem is they are wayy to outdated for csups need. The reason is mainly because they don't support: 1) reentrancy (needed since csup uses two threads, one to send information to the server regarding it's files, and one to recieve information on how a file is to be updated). 2) prefixing of lex/yacc output. Not a big deal, but easy if one doesn't need to have to work around it. 3) parameter passing. Part of the reentrancy requirement but useful if one would extend the arguments to a parser. Because of this, I've been compiling the parser and tokenizer with the help of bison and flex from ports. Now, the base system already have flex, but the flex version in base is heavily outdated (version 2.5.4 versus 2.5.34 in ports) and does not support reentrancy. Is there a reason why it's outdated? What I can think of is that it is either unmaintained, or that developers want it to disappear from base. The yacc version in base is pretty old too and does not support reentrancy. I would like to not have to hack it up to support this to avoid using bison, (And I suspect importing bison into base is going to happen over someones dead body :)). So, I'm asking you, how should I best deal with this? Should I a) Just include the _generated_ parser and tokenizer (e.g the output from bison and flex) and just include the yacc and lex files in case someone wants to work more on it? b) Modify parser to be non-reentrant and solve my issues with locks. c) Import bison into base and update flex version. d) Alternative 'a' is my favorite, and seems to be the easiest way to avoid a heavy inpact on the base system, but again it will complicate procedure of modifying the parser since one have to use the correct build tools etc. 'b' would lead to performance loss and I would very much like to avoid it. 'c' would take a lot of work and I think many would protest on importing bison (including me if I were not biased with needing it and all :)) What I ask of you is comments on these alternatives as well as inserting your fantastic idea if you happen to have one :) -- Ulf Lilleengen