From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark H Weaver Subject: Re: [PATCH 1/4] gnu: base: Add glibc-hurd and hurd-minimal. Date: Tue, 17 Feb 2015 17:50:02 -0500 Message-ID: <87mw4c6tlx.fsf@netris.org> References: <87h9uoghnl.fsf@netris.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45565) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNqxs-0006gS-Ff for Guix-devel@gnu.org; Tue, 17 Feb 2015 17:50:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YNqxo-0004UN-14 for Guix-devel@gnu.org; Tue, 17 Feb 2015 17:50:00 -0500 Received: from world.peace.net ([50.252.239.5]:54474) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNqxn-0004UF-Tv for Guix-devel@gnu.org; Tue, 17 Feb 2015 17:49:55 -0500 In-Reply-To: <87h9uoghnl.fsf@netris.org> (Mark H. Weaver's message of "Sat, 14 Feb 2015 19:09:02 -0500") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Manolis Ragkousis Cc: Guix-devel Mark H Weaver writes: > Manolis Ragkousis writes: > >> + ,@(substitute-keyword-arguments (package-arguments glibc) >> + ((#:configure-flags cf) >> + `(append (list "--host=i686-pc-gnu" >> + >> + ;; nscd fails to build for GNU/Hurd: >> + ;; . >> + ;; Disable it. >> + "--disable-nscd"))) > > Did you intend to omit 'cf', the inherited configure-flags from 'glibc'? > Also, you're passing only one argument to 'append', making it a no-op. > > Looking at the configure-flags for 'glibc', most of them look desirable > on Hurd, but some of them don't. [...] [...] > How about this: (untested) > > ((#:configure-flags original-configure-flags) > `(list "--host=i686-pc-gnu" > > ;; nscd fails to build for GNU/Hurd: > ;; . > ;; Disable it. > "--disable-nscd" > > ,@(filter (lambda (flag) > (not (or (string-prefix? "--with-headers=" flag) > (string-prefix? "--enable-kernel=" flag)))) > original-configure-flags))) The code above didn't work, for two reasons: (1) 'original-configure-flags' is not actually a list of flags, but rather a scheme expression that evaluates to a list of flags. (2) Evaluating 'original-configure-flags' fails in this context, because it includes the expression (from our glibc package) (string-append "--with-headers=" (assoc-ref %build-inputs "linux-headers") "/include") but in this glibc/hurd package, there is no 'linux-headers' input, so the 'assoc-ref' returns #f and 'string-append' fails. After a few iterations on IRC, I proposed this code which seems to work: --8<---------------cut here---------------start------------->8--- ((#:configure-flags original-configure-flags) `(append (list "--host=i686-pc-gnu" ;; nscd fails to build for GNU/Hurd: ;; . ;; Disable it. "--disable-nscd") (filter (lambda (flag) (not (or (string-prefix? "--with-headers=" flag) (string-prefix? "--enable-kernel=" flag)))) ;; Evaluate 'original-configure-flags' in a ;; lexical environment that has a dummy ;; "linux-headers" input, to prevent errors. (let ((%build-inputs `(("linux-headers" "@DUMMY@") ,@%build-inputs))) ,original-configure-flags)))) --8<---------------cut here---------------end--------------->8--- but obviously it's a bit gross. Ideally, we consider consider having a 'glibc/base' package that is inherited by both 'glibc/linux' and 'glibc/hurd'. The base package would not add any linux stuff, on the theory that it is easier and cleaner to add kernel-specific stuff than to remove it. Thoughts? Mark