From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Marusich Subject: Re: broken references in jar manifests Date: Mon, 19 Mar 2018 05:24:19 +0100 Message-ID: <87k1u8u1zg.fsf@gmail.com> References: <87d10nmxrw.fsf@elephly.net> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35690) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1exmLT-00083A-77 for guix-devel@gnu.org; Mon, 19 Mar 2018 00:24:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1exmLS-0006tr-3x for guix-devel@gnu.org; Mon, 19 Mar 2018 00:24:27 -0400 Received: from mail-pf0-x230.google.com ([2607:f8b0:400e:c00::230]:36139) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1exmLR-0006tl-TB for guix-devel@gnu.org; Mon, 19 Mar 2018 00:24:26 -0400 Received: by mail-pf0-x230.google.com with SMTP id 68so6577811pfx.3 for ; Sun, 18 Mar 2018 21:24:25 -0700 (PDT) In-Reply-To: (=?utf-8?Q?=22G=C3=A1bor?= Boskovits"'s message of "Thu, 1 Mar 2018 20:08:53 +0100") 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: =?utf-8?Q?G=C3=A1bor?= Boskovits Cc: Guix-devel , Ricardo Wurmus --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable G=C3=A1bor Boskovits writes: > 2018-03-01 19:54 GMT+01:00 Ricardo Wurmus : > >> >> G=C3=A1bor Boskovits writes: >> >> > 2018-03-01 18:11 GMT+01:00 Ricardo Wurmus >> : >> > >> >> Hi Guix, >> >> >> >> we have a problem with jar manifests. When we use the Class-Path >> >> property to ensure that an executable can find its dependencies on the >> >> 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 mea= ns >> >> 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 depe= ndencies. The >> manifest can then contain relative paths to these symlinks. >> >> > I guess I would prefer to do this instead. Sounds good to me, too. Ricardo Wurmus writes: > A possible work-around might be to patch the class loader of our JDKs to > look at a custom Guix-specific file, which we will include in each jar. > That file would be allowed to have longer lines. > > There are two disadvantages: > > 1) we need to patch the JDK > 2) the jars would not do the right thing when executed with a different > JDK (e.g. on a foreign distro). We shouldn't be afraid to experiment with a custom class loader. It may turn out to be an effective way to "teach" Java how to follow store references, and the class loader machinery is well pretty documented. The tricks we (and Nix) do with the linker (e.g., ld-wrapper) to always use rpaths for C programs and libraries is similar in spirit: if the machine does not know our rules by default, we must teach the machine how to play by our rules. =2D-=20 Chris --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEy/WXVcvn5+/vGD+x3UCaFdgiRp0FAlqvO3QACgkQ3UCaFdgi Rp2pEBAAuwg0VbYDNKQZj6SPH1w7UgFdsVYWwoWG1zv9JZ09Xk3wj/gQYVIfVDDz gohnyRrnc/dk1hZ7izLEX/SzjCBu8BJB+vLB2TUpVcVMpoLt2vTVH1eLJcB1V4B/ DLqIto5x4n7X4AX22kjF2JlFYyeB3xZGk8ZEaYhAJBETSbGBE9I31NXgBUjb6r2L PmnxPlMNt15dzJl0lxOo5Fc2T/U37zf0p8ESCWrnPFWjQ7W2YFsCZUKrIl5zyghP DmyyJpoPz6SpGQqbLdZRQrispsOWX0mSZXtd2+2zXCdVDlTXv2vIiIFqL9NYcV7h fEqCrIb6+c6QD1wgKF+/rJnNZ4KcnmAYKpUh2yL48+HtmjZExnMT0/D0Tqd4o4Yg 4hqnFAcCzZT2yyEBxlqVZ4E7iRvYC/Lqh0uEfcdPJaY3ZC1kC22Hsu/04ffWakDM H3S0oC360ipw3eRpVUPguTH3OleTAS5nKa+T95w4uNvWlUUg96S633Dj9/ZEM6Fy mbOgYT78JxoqSwKRDkrTsFNTlgjWWs/cl4BCmxvrHx2PriRVLPmjU8GzUfvDuZ2G q+6b61S7uHqGrxSUXGSfYCmMpJSG+d7qyXLRW8UvcMLTK35YgOBQhuAiIrqIM20R 7lfby0z6emohVZeQMO2G0nskCWXHlwEr3qa0wp1SDX2bDAmde5Q= =h+dg -----END PGP SIGNATURE----- --=-=-=--