Skip to content

Library path changed in new windows 10 update #1006

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

Open
Conplug opened this issue Oct 4, 2020 · 9 comments
Open

Library path changed in new windows 10 update #1006

Conplug opened this issue Oct 4, 2020 · 9 comments
Labels
os: windows Specific to Windows operating system status: waiting for information More information must be provided before work can proceed type: imperfection Perceived defect in any part of project

Comments

@Conplug
Copy link

Conplug commented Oct 4, 2020

Bug Report

Building failed by libraries losing.

Current behavior

I run
arduino-cli lib list
No libraries installed.

Checked the windows's document path, it was changed to
C:\Users\[my name]\OneDrive\Documents\Arduino\libraries

Expected behavior

Environment

  • CLI version (output of arduino-cli version): arduino-cli Version: 0.13.0 Commit: 693a045
  • OS and platform: Windows 10 Pro

Additional context

@ubidefeo
Copy link

ubidefeo commented Oct 5, 2020

hi @Conplug
I think you chose to have all your documents stored on OneDrive and this changed your path.

@arduino/team_tooling I hope this does not turn into a nightmare 🤦‍♂️

@alranel
Copy link
Contributor

alranel commented Oct 5, 2020

I'm not sure this should be handled anyhow in arduino-cli, as that path is entirely provided by the system :)
The easiest solution would be to move your Documents\Arduino folder to the new path, according to your new system configuration.

@ubidefeo
Copy link

ubidefeo commented Oct 5, 2020

@alranel
this requires editing the arduino-cli.yaml file which is in the AppData folder, and it's the default path for our data folder.
The problem is that the default arduino-cli.yaml created in the init process will point to the standard user path, and will not contain OneDrive or account for it.

@Conplug could you edit the arduino-cli.yaml file to point to your new path anywhere necessary?
these are the entries you're interested in for such operation (mine are for Mac OS but you'll be able to change yours easily)

directories:
  data: /Users/ubi/Library/Arduino15
  downloads: /Users/ubi/Library/Arduino15/staging
  user: /data/Dropbox/AppsDocuments/Arduino

@alranel
Copy link
Contributor

alranel commented Oct 5, 2020

Ah, didn't know we store the path during init. In this case I see two possible changes to consider:

  • do not store paths at all during init, and recompute them at every run if the keys are not found in arduino-cli.yaml (i.e. if the user didn't set custom ones manually)
  • in case the stored paths do not exist, try to recompute them on the fly as a fallback

I think the first option is more correct: if we rely on a system-provided path, we should not consider it permanent but we should continue relying on the system providing the path. I don't know if there are implications in arduino-cli, but suggesting this as it's a common pattern :)

@mastrolinux
Copy link
Contributor

Also, consider the Documents dir is protected from external modification in most recent Win10 versions.

@kittaakos
Copy link
Contributor

Documents dir is protected

Related: #566

@matthijskooijman
Copy link
Collaborator

One other option to solve this would be to allow windows variables in the config (e.g. something like %USERDIR% (or whatever that is called exactly, I think such standardized variables exist)?

Yet another (devil's advocate) way to look at this, is that by moving your Documents folder into OneDrive,the user moved Arduino-cli's files, so it's up to them to tell arduino-cli where the files went. If I rename the Arduino folder to something else, arduino-cli cannot autodetect this, so why would this change need to be handled?

@ubidefeo
Copy link

ubidefeo commented Oct 8, 2020

@matthijskooijman
Before beginning to work on this project I thought Apple and their walled gardens (which I'm comfortable with) were hindering developers in many ways, but the amount of issues I see popping up because of Windows' odd behaviours if baffling to say the least 😂

@per1234 per1234 added component/core os: windows Specific to Windows operating system labels Feb 3, 2021
@per1234 per1234 reopened this Mar 30, 2021
@fstasi fstasi removed the type: bug label Sep 16, 2021
@rsora rsora added type: imperfection Perceived defect in any part of project topic: core labels Sep 22, 2021
@umbynos umbynos added the status: waiting for information More information must be provided before work can proceed label Nov 25, 2022
@umbynos
Copy link
Contributor

umbynos commented Nov 25, 2022

Checked the windows's document path, it was changed to

@Conplug what do you mean by "it was changed to"? You changed it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
os: windows Specific to Windows operating system status: waiting for information More information must be provided before work can proceed type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests