Skip to content

OneDrive issues on Windows maybe because $HOME shouldn't be used on Windows #824

Open
@jgabry

Description

@jgabry

@rok-cesnovar @andrjohns We're seeing more Windows installation issues related to OneDrive folders. On the forum @WardBrian suggested that maybe we need to change how we're setting the default install location on Windows:

If I had to guess, these users have %HOME% set to the one drive location, and cmdstanr is using it. Note that this is bad practice on cmdstanr’s part, %HOME% is not one of the standard environment variables on Windows so it can be set to more or less anything (or nothing at all!) unless R is stepping in and monkeypatching this.

In CmdStanPy we use os.path.expanduser which uses a combination of things instead of %HOME% on windows:

On Windows, USERPROFILE will be used if set, otherwise a combination of HOMEPATH and HOMEDRIVE will be used. An initial ~user is handled by checking that the last directory component of the current user’s home directory matches USERNAME, and replacing it if so.
I haven’t seen issues with cmdstanpy and OneDrive yet, so I strongly suspect this difference is the reason

What do you guys think?

(Also see discussion on slack with helpful comments from @WardBrian and @ahartikainen)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingwindows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions