From patchwork Mon Sep 26 10:03:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ben Woodcroft X-Patchwork-Id: 16010 Received: (qmail 114308 invoked by uid 89); 26 Sep 2016 10:04:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.7 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=aborted, H*r:sk:static., H*RU:sk:static., Hx-spam-relays-external:sk:static. X-Spam-Status: No, score=-4.7 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: lists.gnu.org Received: from lists.gnu.org (HELO lists.gnu.org) (208.118.235.17) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 26 Sep 2016 10:04:26 +0000 Received: from localhost ([::1]:43044 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1boSls-0006c0-Is for patchwork@sourceware.org; Mon, 26 Sep 2016 06:04:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45527) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1boSlh-0006aQ-Mo for guix-devel@gnu.org; Mon, 26 Sep 2016 06:04:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1boSlb-0006v3-MU for guix-devel@gnu.org; Mon, 26 Sep 2016 06:04:12 -0400 Received: from mailhub2.soe.uq.edu.au ([130.102.132.209]:55043 helo=newmailhub.uq.edu.au) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1boSlb-0006u3-2W; Mon, 26 Sep 2016 06:04:07 -0400 Received: from smtp2.soe.uq.edu.au (smtp2.soe.uq.edu.au [10.138.113.41]) by newmailhub.uq.edu.au (8.14.5/8.14.5) with ESMTP id u8QA3xTJ033773; Mon, 26 Sep 2016 20:03:59 +1000 Received: from [192.168.1.105] (static.customers.nuskope.com.au [103.25.181.216] (may be forged)) (authenticated bits=0) by smtp2.soe.uq.edu.au (8.14.5/8.14.5) with ESMTP id u8QA3vu5030730 (version=TLSv1.2 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 26 Sep 2016 20:03:59 +1000 Subject: Re: [PATCH 2/2] gnu: perl: Enable threading support. To: =?UTF-8?Q?Ludovic_Court=c3=a8s?= , Ben Woodcroft References: <20160920045607.18936-1-donttrustben@gmail.com> <20160920045607.18936-3-donttrustben@gmail.com> <87fuopriox.fsf@gnu.org> From: Ben Woodcroft Message-ID: <61f55931-6fd2-2fd1-9f61-e52b7302d3b8@uq.edu.au> Date: Mon, 26 Sep 2016 20:03:56 +1000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <87fuopriox.fsf@gnu.org> X-UQ-FilterTime: 1474884240 X-Scanned-By: MIMEDefang 2.73 on UQ Mailhub X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 130.102.132.209 X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel@gnu.org Errors-To: guix-devel-bounces+patchwork=sourceware.org@gnu.org Sender: "Guix-devel" On 24/09/16 15:05, Ludovic Courtès wrote: > Ben Woodcroft 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 From c61c799da21f349c739f9d094d348ae429a91ffc Mon Sep 17 00:00:00 2001 From: Ben Woodcroft 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 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