From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 17 03:11:33 2021 Received: (at 31719) by debbugs.gnu.org; 17 Apr 2021 07:11:33 +0000 Received: from localhost ([127.0.0.1]:42186 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lXf72-0004vK-7q for submit@debbugs.gnu.org; Sat, 17 Apr 2021 03:11:33 -0400 Received: from zancanaro.com.au ([45.76.117.151]:40840) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lXf70-0004vB-62 for 31719@debbugs.gnu.org; Sat, 17 Apr 2021 03:11:27 -0400 Received: by zancanaro.com.au (Postfix, from userid 116) id 589893413D; Sat, 17 Apr 2021 07:11:24 +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="=-=-=" X-Spam-Score: 1.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 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 depe [...] Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 1.2 MISSING_HEADERS Missing To: header -0.0 SPF_PASS SPF: sender matches SPF record X-Debbugs-Envelope-To: 31719 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: 0.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 --=-=-=--