From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 17 03:11:40 2021 Received: (at submit) by debbugs.gnu.org; 17 Apr 2021 07:11:40 +0000 Received: from localhost ([127.0.0.1]:42189 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lXf7A-0004vg-EN for submit@debbugs.gnu.org; Sat, 17 Apr 2021 03:11:40 -0400 Received: from lists.gnu.org ([209.51.188.17]:36642) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lXf74-0004vP-Kh for submit@debbugs.gnu.org; Sat, 17 Apr 2021 03:11:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34354) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lXf74-0004ih-F8 for bug-guix@gnu.org; Sat, 17 Apr 2021 03:11:30 -0400 Received: from zancanaro.com.au ([45.76.117.151]:50282) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lXf72-0004jP-Be for bug-guix@gnu.org; Sat, 17 Apr 2021 03:11:30 -0400 Received: by zancanaro.com.au (Postfix, from userid 116) id 5A91C34140; Sat, 17 Apr 2021 07:11:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on vultr X-Spam-Level: X-Spam-Status: No, score=-1.9 required=4.0 tests=ALL_TRUSTED,BAYES_00, MISSING_HEADERS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from jolteon (n175-37-31-147.bla1.nsw.optusnet.com.au [175.37.31.147]) by zancanaro.com.au (Postfix) with ESMTPSA id 9B2DB33C10; Sat, 17 Apr 2021 07:11:22 +0000 (UTC) References: <877end1pda.fsf@mdc-berlin.de> <87mtvntckt.fsf@gnu.org> <87o8g2pni4.fsf@gnu.org> <20210301231534.1d4e440a@alma-ubu.fritz.box> <878s5ltj0o.fsf@elephly.net> <20210416212233.05ac87de@alma-ubu.fritz.box> <87fszpc1du.fsf@zancanaro.id.au> User-agent: mu4e 1.4.15; emacs 27.2 From: Carlo Zancanaro Subject: Re: bug#31719: Chains of dependencies getting longer In-reply-to: <87fszpc1du.fsf@zancanaro.id.au> Date: Sat, 17 Apr 2021 17:11:20 +1000 Message-ID: <87czutbd2f.fsf@zancanaro.id.au> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=45.76.117.151; envelope-from=carlo@zancanaro.id.au; helo=zancanaro.com.au X-Spam_score_int: -8 X-Spam_score: -0.9 X-Spam_bar: / X-Spam_report: (-0.9 / 5.0 requ) BAYES_00=-1.9, MISSING_HEADERS=1.021, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -0.2 (/) X-Debbugs-Envelope-To: submit Cc: =?utf-8?Q?Bj=C3=B6rn_H=C3=B6fling?= , rekado@elephly.net, 31719@debbugs.gnu.org, bug-guix@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.2 (-) --=-=-= Content-Type: text/plain; format=flowed Here's a patch that should clean up these runtime dependencies. It's a bit specific to this particular case, but I think that might be fine for now. I think it would make more sense for native inputs to not have their paths included in LIBRARY_PATH. Does it even make sense for them to be there? I thought LIBRARY_PATH was for compilers to find dependencies when compiling so they can link their output binaries against them. Having native inputs show up there seems wrong. I'm in the process of rebuilding Java from icedtea-8 upwards to check, but I have already tested that modifying openjdk 9 and 10 leads to "guix gc --references" show that openjdk 10 does not depend on openjdk 9. I have also tested that I can run some complex Java programs on my machine using the openjdk 10 built using this patch. Carlo --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename=0001-gnu-Clean-up-runtime-dependencies-between-Java-versi.patch Content-Transfer-Encoding: quoted-printable From f98dc5ad5662cc62f198d8f50e7dd719cf941315 Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Sat, 17 Apr 2021 16:33:06 +1000 Subject: [PATCH] gnu: Clean up runtime dependencies between Java versions. * gnu/packages/java.scm (icedtea-8, openjdk9, openjdk11): Don't consider icedtea/openjdk input paths when rewriting JNI libraries. --- gnu/packages/java.scm | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index 207f136513..3c4013ab6f 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -2,7 +2,7 @@ ;;; Copyright =C2=A9 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ricardo Wurm= us ;;; Copyright =C2=A9 2016 Leo Famulari ;;; Copyright =C2=A9 2016, 2017 Roel Janssen -;;; Copyright =C2=A9 2017, 2019 Carlo Zancanaro +;;; Copyright =C2=A9 2017, 2019, 2021 Carlo Zancanaro ;;; Copyright =C2=A9 2017-2020 Julien Lepiller ;;; Copyright =C2=A9 2017 Thomas Danckaert ;;; Copyright =C2=A9 2016, 2017, 2018 Alex Vong @@ -1792,8 +1792,13 @@ new Date();")) (add-after 'unpack 'patch-jni-libs ;; Hardcode dynamically loaded libraries. (lambda _ - (let* ((library-path (search-path-as-string->list - (getenv "LIBRARY_PATH"))) + (use-modules (srfi srfi-1)) + (define (icedtea-or-openjdk? path) + (or (string-contains path "openjdk") + (string-contains path "icedtea"))) + (let* ((library-path (remove icedtea-or-openjdk? + (search-path-as-string->= list + (getenv "LIBRARY_PATH")= ))) (find-library (lambda (name) (search-path library-path @@ -1931,12 +1936,18 @@ new Date();")) (add-after 'unpack 'patch-jni-libs ;; Hardcode dynamically loaded libraries. (lambda _ - (let* ((library-path (search-path-as-string->list - (getenv "LIBRARY_PATH"))) + (use-modules (srfi srfi-1)) + (define (icedtea-or-openjdk? path) + (or (string-contains path "openjdk") + (string-contains path "icedtea"))) + (let* ((library-path (remove icedtea-or-openjdk? + (search-path-as-string->list + (getenv "LIBRARY_PATH")))) (find-library (lambda (name) - (search-path - library-path - (string-append "lib" name ".so"))))) + (or (search-path + library-path + (string-append "lib" name ".so")) + (string-append "lib" name ".so")))= )) (for-each (lambda (file) (catch 'decoding-error @@ -2139,8 +2150,13 @@ new Date();")) (add-after 'unpack 'patch-jni-libs ;; Hardcode dynamically loaded libraries. (lambda _ - (let* ((library-path (search-path-as-string->list - (getenv "LIBRARY_PATH"))) + (use-modules (srfi srfi-1)) + (define (icedtea-or-openjdk? path) + (or (string-contains path "openjdk") + (string-contains path "icedtea"))) + (let* ((library-path (remove icedtea-or-openjdk? + (search-path-as-string->list + (getenv "LIBRARY_PATH")))) (find-library (lambda (name) (search-path library-path --=20 2.31.1 --=-=-=--