From owner-freebsd-ruby@freebsd.org Tue Jan 3 15:20:17 2017 Return-Path: Delivered-To: freebsd-ruby@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9350C9D957 for ; Tue, 3 Jan 2017 15:20:17 +0000 (UTC) (envelope-from swills@FreeBSD.org) Received: from mouf.net (mouf.net [IPv6:2607:fc50:0:4400:216:3eff:fe69:33b3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mouf.net", Issuer "mouf.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7E29C1BF5 for ; Tue, 3 Jan 2017 15:20:17 +0000 (UTC) (envelope-from swills@FreeBSD.org) Received: from [10.0.1.70] (cpe-071-065-239-148.nc.res.rr.com [71.65.239.148] (may be forged)) (authenticated bits=0) by mouf.net (8.14.9/8.14.9) with ESMTP id v03FK9jp094685 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Tue, 3 Jan 2017 15:20:14 GMT (envelope-from swills@FreeBSD.org) Subject: Re: PREFIX enviroment variable pollutes gem search path To: "=?UTF-8?Q?Jos=c3=a9_G._Juanino?=" , freebsd-ruby@freebsd.org References: <20170103000758.pnoglvxtseec2xpn@abel.home.inet> <20170103142749.62nzduottim5wxpj@abel.home.inet> From: Steve Wills Message-ID: <5a2c04e1-81bb-41f6-e727-9b4a53682d9b@FreeBSD.org> Date: Tue, 3 Jan 2017 10:20:07 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20170103142749.62nzduottim5wxpj@abel.home.inet> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="rpxmx7K0kUqNoFej6TbVtFCeUfpWwLNTA" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mouf.net [199.48.129.64]); Tue, 03 Jan 2017 15:20:15 +0000 (UTC) X-Spam-Status: No, score=-1.0 required=4.5 tests=ALL_TRUSTED autolearn=unavailable autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mouf.net X-Virus-Scanned: clamav-milter 0.99.2 at mouf.net X-Virus-Status: Clean X-BeenThere: freebsd-ruby@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: FreeBSD-specific Ruby discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2017 15:20:17 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --rpxmx7K0kUqNoFej6TbVtFCeUfpWwLNTA Content-Type: multipart/mixed; boundary="wUWOggkHs38pDvO0kGpgl7w3q7Bhvj1S6"; protected-headers="v1" From: Steve Wills To: =?UTF-8?Q?Jos=c3=a9_G._Juanino?= , freebsd-ruby@freebsd.org Message-ID: <5a2c04e1-81bb-41f6-e727-9b4a53682d9b@FreeBSD.org> Subject: Re: PREFIX enviroment variable pollutes gem search path References: <20170103000758.pnoglvxtseec2xpn@abel.home.inet> <20170103142749.62nzduottim5wxpj@abel.home.inet> In-Reply-To: <20170103142749.62nzduottim5wxpj@abel.home.inet> --wUWOggkHs38pDvO0kGpgl7w3q7Bhvj1S6 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Hi, On 01/03/2017 09:27, Jos=E9 G. Juanino wrote: >> In short: you cannot load any gem if your environment contains the >> PREFIX variable. When this happens, ruby uses the assigned value >> instead of /usr/local to search the proper files. This breaks a lot of= >> existent code. >> >> The relevant ports are, installed via pkg: >> >> ruby-2.2.5_1,1 >> ruby22-gems-2.6.4 >> ruby23-2.3.1_1,1 >> >> The FreeBSD version is 11.0-RELEASE. >> >> This issue did not happen in ruby20, I think. >=20 > I think that the root issue is this sentence in lang/ruby22 Makefile: >=20 > @${RB_SET_CONF_VAR} "prefix" "ENV['PREFIX'] || \3" >=20 >=20 > It set the following in > /usr/local/lib/ruby/2.2/amd64-freebsd11/rbconfig.rb: >=20 > CONFIG["prefix"] =3D (ENV['PREFIX'] || TOPDIR || DESTDIR + "/usr/local"= ) >=20 > That is wrong, as rbconfig.rb is sourced by gem infraestructure, and > therefore the result is dependent of your specific environment at > *runtime*. > (Please keep me in Cc:, as I am not subscribed to the list). >=20 This was added in r210636 (nearly 8 years ago) to "allow modules to be installed into separate PREFIX and/or under user privilegies" (sic) and so far I believe this is the first issue I've seen with it. Can you explain in more detail what existing code this breaks and how specifically it breaks? It may not be necessary and I actually considered removing it when adding 2.4 recently but I need to understand it in more detail first (which is why I didn't remove it already). While this may break things for some, I can imagine others relying on it. Thanks, Steve --wUWOggkHs38pDvO0kGpgl7w3q7Bhvj1S6-- --rpxmx7K0kUqNoFej6TbVtFCeUfpWwLNTA Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQGQBAEBCgB6BQJYa8EnXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ5OEZBNDE0QTVDMkEwRUY5Q0ZEMEFEMERG NUNGNjJCMzIwN0IxQkExExxzd2lsbHNAZnJlZWJzZC5vcmcACgkQ9c9isyB7G6Fk 1Af/bMgbxqmxnyhRHqwID08zhmeG3Ahcx2L437tIK6xVd7gdELuyQcdVWnYZXKUH D3OeM90aTwSvAR1vbFzwVvUa8PNUkmq1sEKGLOroIS2n7ZQcSgoSCBgevM245Zj0 wINeNgIXiRn6q1XTJ4ZoLtfwdTB5qBYsm5fwxgbAe4X9xrztoBK/Uizxsc0aAsOt vIT4OsVDDnChrmB7x1xS2w/4pWgrkukPKvQy3skx3DnkRS1FGpbk36Glqf7dL7A5 +0gNcfp3P/L+wP4db8RTfi5LhZ0S4AOHdKmsJNgwGrUbwTrd5f8v+jRbK/jR9UR5 H+58lpNxzEzmo9v2+6LusiW83g== =joRl -----END PGP SIGNATURE----- --rpxmx7K0kUqNoFej6TbVtFCeUfpWwLNTA--