GNU bug report logs - #48576
R: .libPaths dereferences symbolic links; requires restart after "guix install STUFF"

Previous Next

Package: guix;

Reported by: Maxime Devos <maximedevos <at> telenet.be>

Date: Fri, 21 May 2021 22:24:01 UTC

Severity: normal

To reply to this bug, email your comments to 48576 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#48576; Package guix. (Fri, 21 May 2021 22:24:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Maxime Devos <maximedevos <at> telenet.be>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Fri, 21 May 2021 22:24:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: bug-guix <at> gnu.org
Subject: R: .libPaths dereferences symbolic links; requires restart after
 "guix install STUFF"
Date: Sat, 22 May 2021 00:22:56 +0200
[Message part 1 (text/plain, inline)]
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.
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 2 years and 338 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.