Skip to content

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

Open
@chrisphe

Description

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))?;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions