From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: Re: broken references in jar manifests Date: Mon, 19 Mar 2018 05:47:11 +0100 Message-ID: <877eq8u0xc.fsf@elephly.net> References: <87d10nmxrw.fsf@elephly.net> <87k1u8u1zg.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39572) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1exmiF-0005H1-9d for guix-devel@gnu.org; Mon, 19 Mar 2018 00:48:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1exmiC-0003qw-7K for guix-devel@gnu.org; Mon, 19 Mar 2018 00:47:59 -0400 Received: from sender-of-o51.zoho.com ([135.84.80.216]:21104) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1exmiB-0003pm-SZ for guix-devel@gnu.org; Mon, 19 Mar 2018 00:47:56 -0400 In-reply-to: <87k1u8u1zg.fsf@gmail.com> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Chris Marusich Cc: Guix-devel , Ricardo Wurmus Chris Marusich writes: >>> >> we have a problem with jar manifests. When we use the Class-Path >>> >> property to ensure that an executable can find its dependencies on t= he >>> >> class path at run-time, we end up with a manifest like this: >>> >> >>> >> --8<---------------cut here---------------start------------->8--- >>> >> Manifest-Version: 1.0 >>> >> Class-Path: /gnu/store/i28vi94r8z9f0x02zgkrv87w16ibmqkw-java-htsjdk-= 2. >>> >> 10.1/share/java/htsjdk.jar >>> >> Created-By: 1.8.0_151 (Oracle Corporation) >>> >> Main-Class: picard.cmdline.PicardCommandLine >>> >> --8<---------------cut here---------------end--------------->8--- >>> >> >>> >> Note that the Class-Path property is broken into two lines. This me= ans >>> >> that the reference scanner will miss it and grafting will fail. > > That is quite unfortunate. :-( > >>> An alternative to recording full references in the manifest file is to >>> install a =E2=80=9Clib=E2=80=9D directory that contains symlinks to dep= endencies. The >>> manifest can then contain relative paths to these symlinks. >>> >>> >> I guess I would prefer to do this instead. > > Sounds good to me, too. Actually, I think this wouldn=E2=80=99t work after all. When the reference= s in the Class-Path property are split up they would be overlooked when grafting. The references in the separate custom file would be grafted. The result is that the applications would keep trying to load the old, ungrafted jars while Guix would think that the package only retained references to the grafted packages. Equally bad: the garbage collector would trash these ungrafted references as it cannot detect them, thus breaking the application. -- Ricardo GPG: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC https://elephly.net