unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: Manolis Ragkousis <manolis837@gmail.com>
Cc: Guix-devel <Guix-devel@gnu.org>
Subject: Re: [PATCH 1/4] gnu: base: Add glibc-hurd and hurd-minimal.
Date: Sat, 14 Feb 2015 19:09:02 -0500	[thread overview]
Message-ID: <87h9uoghnl.fsf@netris.org> (raw)
In-Reply-To: <CAFtzXzM9qWM=9h2n9S-Rk1sxuPfexq0FWQgEyT8QNtrBQgZe8w@mail.gmail.com> (Manolis Ragkousis's message of "Sat, 14 Feb 2015 17:40:17 +0200")

Manolis Ragkousis <manolis837@gmail.com> writes:

> There was only a minor change here, to work around the error I told
> you in a previous mail.
>
> http://lists.gnu.org/archive/html/guix-devel/2015-02/msg00156.html
>
> From c9fd013956718c4d3178608b3eca6392b6f5cea3 Mon Sep 17 00:00:00 2001
> From: Manolis Ragkousis <manolis837@gmail.com>
> Date: Sat, 27 Sep 2014 20:07:19 +0300
> Subject: [PATCH 1/4] gnu: base: Add glibc-hurd and hurd-minimal.
>
> Reinstates commit bc046a94, among other things.

What do you mean by "reinstates"?  I'm not sure there's a need to
reference this obsolete commit.

[...]
> diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
> index be33cb2..556eb47 100644
> --- a/gnu/packages/base.scm
> +++ b/gnu/packages/base.scm
> @@ -4,6 +4,7 @@
>  ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
>  ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
>  ;;; Copyright © 2014 Alex Kost <alezost@gmail.com>
> +;;; Copyright © 2014 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>

I would add 2015 now also.

>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -32,9 +33,13 @@
>    #:use-module (gnu packages perl)
>    #:use-module (gnu packages linux)
>    #:use-module (gnu packages texinfo)
> +  #:use-module (gnu packages gettext)
> +  #:use-module (gnu packages hurd)
>    #:use-module (gnu packages pkg-config)
> +  #:use-module (guix utils)
>    #:use-module (guix packages)
>    #:use-module (guix download)
> +  #:use-module (guix git-download)
>    #:use-module (guix build-system gnu))
>  
>  ;;; Commentary:
> @@ -520,6 +525,105 @@ with the Linux kernel.")
>     (license lgpl2.0+)
>     (home-page "http://www.gnu.org/software/libc/")))
>  
> +(define-public glibc/hurd
> +  (package (inherit glibc)
> +    (name "glibc-hurd")
> +    (version "2.18")
> +    (source (origin
> +              (method git-fetch)
> +              (uri (git-reference
> +                    (url "git://git.sv.gnu.org/hurd/glibc")
> +                    (commit "a9d8d3808f18de4da9b587e9bdfb6cca4704344b")))
> +              (sha256
> +               (base32
> +                "0jmczzdyps5syhrqyf7lgl3h77br8s74qw0417jp8b4f29ks7pbz"))
> +              (file-name (string-append name "-" version))
> +              (patches (map search-patch
> +                            '("glibc-make-4.0.patch"
> +                              "glibc-hurd-extern-inline.patch")))))
> +
> +    ;; Libc provides <hurd.h>, which includes a bunch of Hurd and Mach headers,
> +    ;; so both should be propagated.
> +    (propagated-inputs `(("gnumach-headers" ,gnumach-headers)
> +                         ("hurd-headers" ,hurd-headers)
> +                         ("hurd-minimal" ,hurd-minimal)))
> +    (native-inputs
> +     `(,@(package-native-inputs glibc)
> +       ("patch/libpthread-patch" ,(search-patch "libpthread-glibc-preparation.patch"))
> +       ("mig" ,mig)
> +       ("perl" ,perl)
> +       ("libpthread" ,(origin
> +                        (method git-fetch)
> +                        (uri (git-reference
> +                              (url "git://git.sv.gnu.org/hurd/libpthread")
> +                              (commit "f517024dce3e21c525a7b634eab61302d6b99150")))
> +                        (sha256
> +                         (base32
> +                          "0yqfm1hfqlyjzqv3mgf9a3mh4qxx1mqkzn5xiac2vlvji8nns35y"))
> +                        (file-name "libpthread")))))
> +
> +    (arguments
> +     `(#:modules ((guix build utils)
> +                  (guix build gnu-build-system))

This #:modules argument is already the default, and it's not overridden
by the inherited 'glibc' package, so I think it's not needed here.

> +       ,@(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.  The ones that look desirable are:

  "--enable-add-ons"
  "--sysconfdir=/etc"
  "libc_cv_localedir=/run/current-system/locale"
  (string-append "BASH_SHELL="
                 (assoc-ref %build-inputs "bash")
                 "/bin/bash")
  "libc_cv_ssp=no"

The ones that we probably want to remove are:

  (string-append "--with-headers="
                 (assoc-ref %build-inputs "linux-headers")
                 "/include")
  "--enable-kernel=2.6.32"

How about this: (untested)

--8<---------------cut here---------------start------------->8---
           ((#: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)))
--8<---------------cut here---------------end--------------->8---

> +           ((#:phases phases)
> +            `(alist-cons-after
> +              'unpack 'prepare-libpthread
> +              (lambda* (#:key inputs #:allow-other-keys)
> +                (copy-recursively (assoc-ref inputs "libpthread") "libpthread")
> +
> +                (system* "patch" "-p1" "-i"
> +                         (assoc-ref %build-inputs "patch/libpthread-patch"))

Better to use 'inputs' not '%build-inputs' here.  Also, you should also
pass "--force" to 'patch', and check the result status for errors.

--8<---------------cut here---------------start------------->8---
                (unless (zero? (system*
                                "patch" "--force" "-p1" "-i"
                                (assoc-ref inputs "patch/libpthread-patch")))
                  (error "patch/libpthread-patch failed"))
--8<---------------cut here---------------end--------------->8---

> +
> +                ;; Make the file writable.
> +                (chmod "bits/pthreadtypes.h" #o666)

Making it world-writable seems excessive.  How about #o644 ?

> +                (copy-recursively "libpthread/sysdeps/generic/bits" "bits"))

Add a #t to the end here, since 'copy-recursively' doesn't return
anything in particular.

--8<---------------cut here---------------start------------->8---
                (copy-recursively "libpthread/sysdeps/generic/bits" "bits")
                #t)
--8<---------------cut here---------------end--------------->8---

Can you make these changes, see if things still work, and then post an
updated patch?

Thanks for working on this!

      Mark

  reply	other threads:[~2015-02-15  0:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-14 15:40 [PATCH 1/4] gnu: base: Add glibc-hurd and hurd-minimal Manolis Ragkousis
2015-02-15  0:09 ` Mark H Weaver [this message]
2015-02-17 22:50   ` Mark H Weaver
2015-02-18  9:37     ` Manolis Ragkousis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h9uoghnl.fsf@netris.org \
    --to=mhw@netris.org \
    --cc=Guix-devel@gnu.org \
    --cc=manolis837@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).