From: Ben Woodcroft <b.woodcroft@uq.edu.au>
To: "Ludovic Courtès" <ludo@gnu.org>,
"Ben Woodcroft" <donttrustben@gmail.com>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH 2/2] gnu: perl: Enable threading support.
Date: Mon, 26 Sep 2016 20:03:56 +1000 [thread overview]
Message-ID: <61f55931-6fd2-2fd1-9f61-e52b7302d3b8@uq.edu.au> (raw)
In-Reply-To: <87fuopriox.fsf@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 1199 bytes --]
On 24/09/16 15:05, Ludovic Courtès wrote:
> Ben Woodcroft <donttrustben@gmail.com> skribis:
>
>> * gnu/packages/perl.scm (perl)[arguments]: Enable threading support.
>> * gnu/packages/commencement.scm (perl-boot0): Do not inherit 'configure'
>> phase from perl.
> [...]
>
>> "-Uinstallusrbinperl"
>> "-Dinstallstyle=lib/perl5"
>> "-Duseshrplib"
>> + "-Dusethreads"
> Is -Dusethreads really needed? I thought the default behavior was to
> build pthread support if ./Configure detects it. That would greatly
> simplify things.
Afraid so. On master:
$ ./pre-inst-env guix environment -C --ad-hoc perl -- perl -e 'use threads'
This Perl not built to support threads
Compilation failed in require at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
> If not, a variant of what Eric suggests would be to honor
> #:configure-flags in this phase, such that all you need is to provide
> different #:configure-flags in perl-boot0.
I like this approach as it is it more general. Attached a 2-in-1 patch
to implement it.
> HTH!
Indeed, good idea thanks.
ben
[-- Attachment #2: perl-threading20160925.patch --]
[-- Type: text/x-patch, Size: 5917 bytes --]
From c61c799da21f349c739f9d094d348ae429a91ffc Mon Sep 17 00:00:00 2001
From: Ben Woodcroft <donttrustben@gmail.com>
Date: Sat, 24 Sep 2016 22:44:55 +1000
Subject: [PATCH 1/2] gnu: perl: Use configure-flags.
* gnu/packages/perl.scm (perl)[arguments]: Use configure-flags.
---
gnu/packages/perl.scm | 31 ++++++++++++++++---------------
1 file changed, 16 insertions(+), 15 deletions(-)
diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index f0c4e36..aea05dd 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -60,6 +60,19 @@
(build-system gnu-build-system)
(arguments
'(#:tests? #f
+ #:configure-flags
+ (let ((out (assoc-ref %outputs "out"))
+ (libc (assoc-ref %build-inputs "libc")))
+ (list
+ (string-append "-Dprefix=" out)
+ (string-append "-Dman1dir=" out "/share/man/man1")
+ (string-append "-Dman3dir=" out "/share/man/man3")
+ "-de" "-Dcc=gcc"
+ "-Uinstallusrbinperl"
+ "-Dinstallstyle=lib/perl5"
+ "-Duseshrplib"
+ (string-append "-Dlocincpth=" libc "/include")
+ (string-append "-Dloclibpth=" libc "/lib")))
#:phases
(modify-phases %standard-phases
(add-before 'configure 'setup-configure
@@ -77,21 +90,9 @@
#t))
(replace
'configure
- (lambda* (#:key inputs outputs #:allow-other-keys)
- (let ((out (assoc-ref outputs "out"))
- (libc (assoc-ref inputs "libc")))
- (zero?
- (system* "./Configure"
- (string-append "-Dprefix=" out)
- (string-append "-Dman1dir=" out "/share/man/man1")
- (string-append "-Dman3dir=" out "/share/man/man3")
- "-de" "-Dcc=gcc"
- "-Uinstallusrbinperl"
- "-Dinstallstyle=lib/perl5"
- "-Duseshrplib"
- (string-append "-Dlocincpth=" libc "/include")
- (string-append "-Dloclibpth=" libc "/lib"))))))
-
+ (lambda* (#:key configure-flags #:allow-other-keys)
+ (zero? (apply system* (append (list "./Configure")
+ configure-flags)))))
(add-before
'strip 'make-shared-objects-writable
(lambda* (#:key outputs #:allow-other-keys)
--
2.10.0
From d382e48d801406897c27b045ab1feb20cfec6db4 Mon Sep 17 00:00:00 2001
From: Ben Woodcroft <donttrustben@gmail.com>
Date: Sat, 24 Sep 2016 23:22:54 +1000
Subject: [PATCH 2/2] gnu: perl: Enable threading support.
* gnu/packages/perl.scm (perl)[arguments]: Configure with '-Dusethreads'.
* gnu/packages/commencement.scm (perl-boot0)[arguments]: Omit inherited
'-Dusethreads' flag during configure.
---
gnu/packages/commencement.scm | 32 ++++++++++++++++++++------------
gnu/packages/perl.scm | 3 ++-
2 files changed, 22 insertions(+), 13 deletions(-)
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 8f1ecf8..61df290 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -275,18 +275,26 @@
(replacement #f)
(arguments
;; At the very least, this must not depend on GCC & co.
- (let ((args `(#:disallowed-references
- ,(list %bootstrap-binutils))))
- (substitute-keyword-arguments (package-arguments perl)
- ((#:phases phases)
- `(modify-phases ,phases
- ;; Pthread support is missing in the bootstrap compiler
- ;; (broken spec file), so disable it.
- (add-before 'configure 'disable-pthreads
- (lambda _
- (substitute* "Configure"
- (("^libswanted=(.*)pthread" _ before)
- (string-append "libswanted=" before)))))))))))))
+ (let
+ ((args `(#:disallowed-references
+ ,(list %bootstrap-binutils)))
+ (sub1
+ (substitute-keyword-arguments (package-arguments perl)
+ ((#:phases phases)
+ `(modify-phases ,phases
+ ;; Pthread support is missing in the bootstrap
+ ;; compiler (broken spec file), so disable it.
+ (add-before 'configure 'disable-pthreads
+ (lambda _
+ (substitute* "Configure"
+ (("^libswanted=(.*)pthread" _ before)
+ (string-append "libswanted="
+ before))))))))))
+ (substitute-keyword-arguments sub1
+ ;; Do not configure with -Dusethreads since pthread
+ ;; support is missing.
+ ((#:configure-flags configure-flags)
+ `(delete "-Dusethreads" ,configure-flags))))))))
(package-with-bootstrap-guile
(package-with-explicit-inputs perl
%boot0-inputs
diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index aea05dd..4e1e7e1 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -72,7 +72,8 @@
"-Dinstallstyle=lib/perl5"
"-Duseshrplib"
(string-append "-Dlocincpth=" libc "/include")
- (string-append "-Dloclibpth=" libc "/lib")))
+ (string-append "-Dloclibpth=" libc "/lib")
+ "-Dusethreads"))
#:phases
(modify-phases %standard-phases
(add-before 'configure 'setup-configure
--
2.10.0
next prev parent reply other threads:[~2016-09-26 10:04 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-20 4:56 [PATCH 0/2] Perl: Enable threading support Ben Woodcroft
2016-09-20 4:56 ` [PATCH 1/2] gnu: perl: Split configure phase Ben Woodcroft
2016-09-24 5:02 ` Ludovic Courtès
2016-09-20 4:56 ` [PATCH 2/2] gnu: perl: Enable threading support Ben Woodcroft
2016-09-24 5:05 ` Ludovic Courtès
2016-09-26 10:03 ` Ben Woodcroft [this message]
2016-10-01 13:22 ` Ludovic Courtès
2016-10-01 16:40 ` Core-updates timeline (was: Re: [PATCH 2/2] gnu: perl: Enable threading support.) Leo Famulari
2016-10-02 13:38 ` Core-updates timeline Ludovic Courtès
2016-10-02 18:50 ` Leo Famulari
2016-10-02 20:14 ` libarchive security fixes (was Re: Core-updates timeline) Leo Famulari
2016-10-03 16:10 ` Ludovic Courtès
2016-10-03 18:14 ` Leo Famulari
2016-10-07 20:16 ` Core-updates timeline Ludovic Courtès
2016-09-20 20:58 ` [PATCH 0/2] Perl: Enable threading support Eric Bavier
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=61f55931-6fd2-2fd1-9f61-e52b7302d3b8@uq.edu.au \
--to=b.woodcroft@uq.edu.au \
--cc=donttrustben@gmail.com \
--cc=guix-devel@gnu.org \
--cc=ludo@gnu.org \
/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).