Skip to content

Installation error: unsafe absolute working directory name #491

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
johnyaku opened this issue Apr 10, 2025 · 6 comments
Closed

Installation error: unsafe absolute working directory name #491

johnyaku opened this issue Apr 10, 2025 · 6 comments
Labels
reprex needs a minimal reproducible example

Comments

@johnyaku
Copy link

I encounter the following installation error when trying to install fs from source on Linux via renv with an external cache directory set by RENV_PATHS_CACHE.

configure: error: unsafe absolute working directory name
make: *** [Makevars:37: libuv-1.44.2/Makefile] Error 1

Deleting this check allowed the installation to complete successfully.

This may be more of a renv bug than an fs bug, but I wonder about the cost-benefit of this check when installation succeeds without it.

Perhaps this could be downgraded from an error to a warning?

@gaborcsardi
Copy link
Member

That file is part of libuv, and we would prefer not to change it if we don't need to. Maybe you could adapt your path. It does not seem like a good idea to include those characters in a directory name.

@johnyaku
Copy link
Author

How would I adapt my path?
I'm using renv::install() within a project directory but with an external cache set by RENV_PATHS_CACHE

@gaborcsardi
Copy link
Member

Is the problematic character coming from RENV_PATHS_CACHE?

@johnyaku
Copy link
Author

No idea. I bring it up because it is the only absolute path in the whole project.
I'm not sure what other paths I could adapt.

Sounds like I should bring this up with the libuv devs.

@gaborcsardi
Copy link
Member

What do you set RENV_PATHS_CACHE to? What's the problematic full path?

@gaborcsardi gaborcsardi added the reprex needs a minimal reproducible example label Apr 25, 2025
@johnyaku
Copy link
Author

I tracked the problem down to ~/.Renviron where I had:

TMPDIR=/foo/bar/$USER

Changing this to the following fixed the problem:

TMPDIR=/foo/bar/${USER}

R was creating a directory called /foo/bar/'$USER'/ instead of resolving the USER environment variable.

In other words, it wasn't the absolute path to RENV_PATHS_CACHE that was the problem, but rather the unsafe $ in /foo/bar/'$USER'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reprex needs a minimal reproducible example
Projects
None yet
Development

No branches or pull requests

2 participants