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))?;
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 https://github.com/r-lib/rig/blob/dac0aaa2736a5caf4288981a430f52da1114e8d2/src/utils.rs#L231
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: