Skip to content
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

Rig's R install fails at Pak Install Stage on Ubuntu 20.04 with "Failed to find user HOME" #228

Open
chrisphe opened this issue Apr 26, 2024 · 2 comments
Labels
bug an unexpected problem or unintended behavior

Comments

@chrisphe
Copy link

When installing an R runtime, Rig fails with the following error:

[INFO] Installing pak for R 4.3.2 (if not installed yet)
[ERROR] Failed to install pak for R 4.3.2: Failed to find user HOME

Currently, we have been able to work around this with the '--without-pak' switch.

The issue arises because of how Rig determines a user's home directory in

let user_record = nix::unistd::User::from_uid(ouid)?

The above referenced code attempts to extract the home directory from /etc/passwd. In the Linux environment I am using there is no user entry in /etc/passwd due to the way user logins are managed. To resolve this it would be great if Rig could fallback to using $HOME environment variable if the home directory cannot be extracted from /etc/passwd.

Something like the following should address this:

let user_record = nix::unistd::User::from_uid(ouid)
.or(env::var("HOME"))?
.ok_or(SimpleError::new("Failed to find user HOME))?;
@gaborcsardi
Copy link
Member

Ah, thanks a lot for the debugging, will fix soon!

@gaborcsardi gaborcsardi added the bug an unexpected problem or unintended behavior label Apr 26, 2024
@natemcintosh
Copy link

natemcintosh commented May 15, 2024

I know adding a new dependency might not be ideal, but the home crate is pretty good at getting a user's home directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants