-
-
Notifications
You must be signed in to change notification settings - Fork 406
build_cache.path correction #2921
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
Conversation
might as well use values from go docs https://pkg.go.dev/os#UserCacheDir cli code fall back to /tmp when neither $HOME or XDG variables are avaiable https://github.com/arduino/arduino-cli/blob/55f86b541026aad880fcb27bc49e3fe1facb223b/internal/cli/configuration/configuration.go#L105-L114
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change you propose from the brace-wrapped placeholders that are currently the established style to environment variables is reasonable, but it must be done comprehensively rather than only in this specific passage of the documentation.
- on Windows is: `{HOME}/AppData/Local/arduino` | ||
- on MacOS is: `{HOME}/Library/Caches/arduino` | ||
`$XDG_CACHE_HOME/arduino`. Otherwise `$HOME/.cache/arduino`. | ||
- on Windows is: `%LocalAppData%/arduino` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- on Windows is: `%LocalAppData%/arduino` | |
- on Windows is: `%LOCALAPPDATA%/arduino` |
This is the canonical capitalization:
> Get-Item -Path Env:LocalAppData
Name Value
---- -----
LOCALAPPDATA C:\Users\per\AppData\Local
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, but Windows is case insensitive here.
It is more readable that just all upper or lower case though?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are going down the path of discussing which of arbitrary forms of the variable name are most clear, I will argue that all caps most effectively communicates that we are referring to an environment variable, as that is the standard convention.
|
||
If neither `$HOME` nor `$XDG_CACHE_HOME` are defined, a temporary directory will be used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If neither `$HOME` nor `$XDG_CACHE_HOME` are defined, a temporary directory will be used. |
This is an emergency "belt and suspenders" fallback measure. We don't need to clutter up the documentation with information that will only be relevant for the <0.01% of users who have a completely borked operating system.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems more evil than reasonable by hiding vital implementation detail :)
The goal is not to please 0.01%, but to have an actual code implementation referenced as doc. In case implementation changes, I would urge to update the doc as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My decision stands. If you don't remove this then the pull request will be rejected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not belt and suspenders, if we are explaining in depth how the system works for the specific reason to avoid misunderstanding it.
Consider container with incorrectly configured env, or incorrectly sandboxed shell session
(...and how I got included in the 0.01% use-cases here...). Not truly impossible thing to happen.
Or a 2nd opinion, perhaps? I am truly misunderstanding the reasoning here, and the harsh response.
Do you mean that PR should change For configuration.md this is indeed the used pattern, but not on other pages. One used style is simply
|
Yes.
Pull requests should be atomic. This means it completely accomplishes a single task. Using multiple pull requests to perform this trivial change would only clutter up the project's commit history.
I agree. I have been bothered by the use of that brace wrapped placeholder style and very much welcome your proposal to change it to something more standardized.
To be clear, I am not requesting you to change the format of platform properties in the documentation. This is only about the placeholders that have an equivalent system environment variable. In the case of platform properties, the brace wrapped format is less unreasonable than |
Please check if the PR fulfills these requirements
See how to contribute
before creating one)
our contributing guidelines
UPGRADING.md
has been updated with a migration guide (for breaking changes)configuration.schema.json
updated if new parameters are added.What kind of change does this PR introduce?
Correction for #2919 and using
$VAR
These are values from Go docs
https://pkg.go.dev/os#UserCacheDir
Actual CLI code falls back to /tmp when neither $HOME or XDG variables are available
arduino-cli/internal/cli/configuration/defaults.go
Line 56 in 55f86b5
arduino-cli/internal/cli/configuration/configuration.go
Lines 105 to 114 in 55f86b5
What is the current behavior?
What is the new behavior?
Does this PR introduce a breaking change, and is [titled accordingly]
Other information