[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/4] gnu: base: Add glibc-hurd and hurd-minimal.
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 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) |
Mark H Weaver <address@hidden> writes:
> Manolis Ragkousis <address@hidden> writes:
>
>> + ,@(substitute-keyword-arguments (package-arguments glibc)
>> + ((#:configure-flags cf)
>> + `(append (list "--host=i686-pc-gnu"
>> +
>> + ;; nscd fails to build for GNU/Hurd:
>> + ;;
>> <https://lists.gnu.org/archive/html/bug-hurd/2014-07/msg00006.html>.
>> + ;; 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:
> ;;
> <https://lists.gnu.org/archive/html/bug-hurd/2014-07/msg00006.html>.
> ;; 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:
;;
<https://lists.gnu.org/archive/html/bug-hurd/2014-07/msg00006.html>.
;; 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