From debbugs-submit-bounces@debbugs.gnu.org Fri May 21 18:23:19 2021 Received: (at submit) by debbugs.gnu.org; 21 May 2021 22:23:19 +0000 Received: from localhost ([127.0.0.1]:37986 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lkDY7-0007gH-He for submit@debbugs.gnu.org; Fri, 21 May 2021 18:23:19 -0400 Received: from lists.gnu.org ([209.51.188.17]:50640) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lkDY4-0007g9-Ki for submit@debbugs.gnu.org; Fri, 21 May 2021 18:23:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50796) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lkDY4-00010V-Eg for bug-guix@gnu.org; Fri, 21 May 2021 18:23:16 -0400 Received: from laurent.telenet-ops.be ([2a02:1800:110:4::f00:19]:37844) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lkDY2-0003Rw-1D for bug-guix@gnu.org; Fri, 21 May 2021 18:23:16 -0400 Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by laurent.telenet-ops.be with bizsmtp id 7aP72500H0mfAB401aP7W9; Sat, 22 May 2021 00:23:07 +0200 Message-ID: Subject: R: .libPaths dereferences symbolic links; requires restart after "guix install STUFF" From: Maxime Devos To: bug-guix@gnu.org Date: Sat, 22 May 2021 00:22:56 +0200 Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-NYgOiLnIyAAyKASeBxhE" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1621635787; bh=ltdno/RiX9Mn/SbqCnbbBEZJFXBrrQx24qqkgH8LlTQ=; h=Subject:From:To:Date; b=vVuvFjRcd7BBtoeU64JsSz5UBSESR+gtCe6Vn6tHkKF/o6TSmAIaqBzDIEXzUQfql bmCZBHfdHBcttnMdx1niu+APSAvLul57MJqhvcTujG5V9FhgAhXyrWlwbtNKr6wQJx sfsnW9vCrBsuX7Bl7LPcWccZn0Ow49RJL7NqSXw3ykb0z9DR2VPPP9xb3y+v88Xwov z2K72K7x6br1BUolZWed4cIl93kUfFVJF11yIzYmWRRawg/2JrLc6n0hsXr/sQqh+0 oOTJ4VT5qU8DSPuNbEOiOlxlR8sMlzfC8NzkxKwV3GD+UwgGgcCZTBWAxk5tsyBUpd HuPFpb6Pbbogw== Received-SPF: pass client-ip=2a02:1800:110:4::f00:19; envelope-from=maximedevos@telenet.be; helo=laurent.telenet-ops.be X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: submit 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: -2.3 (--) --=-NYgOiLnIyAAyKASeBxhE Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Today I started R (from Emacs). I needed mefa::rep.data.frame, so I ran "guix install r-mefa -p ../prof" (actually guix package -p ../prof -m ../manifest.scm, but that shouldn't matter for the purposes of the bug report) (r-mefa is not in the guix repo yet) Now it is installed, I typed in the R prompt: > mefa::rep.data.frame Error in loadNamespace(name) : there is no package called =E2=80=98mefa=E2= =80=99 The solution is to exit the R prompt and restart. Can we do better? It appears the search path is set with .libPaths: > .libPaths function (new)=20 { if (!missing(new)) { new <- Sys.glob(path.expand(new)) paths <- c(new, .Library.site, .Library) paths <- paths[dir.exists(paths)] .lib.loc <<- unique(normalizePath(paths, "/")) } else .lib.loc } > .libPaths() [1] "/gnu/store/5cgx6pkhr300v706sv46gx9ypnwanngw-profile/site-library" = =20 [2] "/gnu/store/6laxfxgjxnisi5fzhvqv82wjrgs7q0md-r-minimal-4.0.4/lib/R/libr= ary" It seems like the symbolic link of ../prof is dereferenced to /gnu/store/5cgx6pkhr300v706sv46gx9ypnwanngw-profile. Promising is the documentation (? base::normalizePath) of base::normalizePa= th: [...] Where the Unix-alike platform supports it attempts to turn paths into absolute paths in their canonical form (no =E2=80=98./=E2=80=99, = =E2=80=98../=E2=80=99 nor **symbolic links**). [...] (emphasis mine) Maybe we make a copy of normalizePath (base:::guix_normalizeLibraryPath?) d= oing the same as base::normalizePath but without dereferencing symbolic links, and adjust .libPaths to use our variant base:::guix_normalizeLibraryPath in= stead of normalizePath? Greetings, Maxime. --=-NYgOiLnIyAAyKASeBxhE Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYKgywRccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7qwiAP9EjJ3p6Oq/4/7gbK2w7+tfPIhg z5Nmgqr7Whbz7WV6dQEA4L5t/Q2oBg4EUee1ecsbXhFsG4/NfEtJvaOqqMv7sAA= =ePwV -----END PGP SIGNATURE----- --=-NYgOiLnIyAAyKASeBxhE--