From: Maxime Devos <maximedevos@telenet.be>
To: 48576@debbugs.gnu.org
Subject: bug#48576: R: .libPaths dereferences symbolic links; requires restart after "guix install STUFF"
Date: Sat, 22 May 2021 00:22:56 +0200 [thread overview]
Message-ID: <fb88c9153595872f5e3697534bebe91506f4a0f8.camel@telenet.be> (raw)
[-- Attachment #1: Type: text/plain, Size: 1738 bytes --]
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 ‘mefa’
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)
{
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
}
<bytecode: 0xe39110>
<environment: 0xe32a48>
> .libPaths()
[1] "/gnu/store/5cgx6pkhr300v706sv46gx9ypnwanngw-profile/site-library"
[2] "/gnu/store/6laxfxgjxnisi5fzhvqv82wjrgs7q0md-r-minimal-4.0.4/lib/R/library"
It seems like the symbolic link of ../prof is dereferenced to
/gnu/store/5cgx6pkhr300v706sv46gx9ypnwanngw-profile.
Promising is the documentation (? base::normalizePath) of base::normalizePath:
[...]
Where the Unix-alike platform supports it attempts to turn paths
into absolute paths in their canonical form (no ‘./’, ‘../’ nor
**symbolic links**). [...] (emphasis mine)
Maybe we make a copy of normalizePath (base:::guix_normalizeLibraryPath?) doing
the same as base::normalizePath but without dereferencing symbolic links,
and adjust .libPaths to use our variant base:::guix_normalizeLibraryPath instead
of normalizePath?
Greetings,
Maxime.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]
reply other threads:[~2021-05-21 22:24 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fb88c9153595872f5e3697534bebe91506f4a0f8.camel@telenet.be \
--to=maximedevos@telenet.be \
--cc=48576@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).