-
-
Notifications
You must be signed in to change notification settings - Fork 208
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
Added the option to use custom paths for the platforms, packages, cache and projects directories and added the option to turn on/off telemetry #3974
base: develop
Are you sure you want to change the base?
Conversation
…he and projects directories and added the option to turn on/off telemetry
This issue has been automatically marked as stale because it has not had recent activity. Please provide more details or it will be closed if no further activity occurs. Thank you for your contributions. |
@@ -149,6 +149,24 @@ class PlatformIOVSCodeExtension { | |||
if (this.getConfiguration('customPyPiIndexUrl')) { | |||
extraVars['PIP_INDEX_URL'] = this.getConfiguration('customPyPiIndexUrl'); | |||
} | |||
|
|||
// configure telemetry | |||
extraVars['PLATFORMIO_SETTING_ENABLE_TELEMETRY'] = this.getConfiguration('enableTelemetry') ? 'yes' : 'no'; |
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.
I'm not a reviewer/submitter, but just as a drive-by...
Don't these need some doc somewhere (I have no idea where) so they show up in https://docs.platformio.org/en/stable/envvars.html, https://docs.platformio.org/en/stable/core/userguide/cmd_settings.html#setting-projects-dir, and such? Is that perhaps automatically generated from the json file?
Is there any missing code (perhaps a missing file?) that actually uses these flags, or is this just a matter of externalizing what's already there? I couldn't find any existing code that looks at enableTelemetry or PLATFORMIO_SETTING_ENABLE_TELEMETRY (and so on down thist list) and changes behavior, so it looks like these are just switches with no wiring in the wall to back them up.
I'll disclaim I know nothing about the project, haven't looked at it beyond code search on gh, etc. I'm just in the peanut gallery reading PRs and this seems odd.
I could be wrong. This might be fine...
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.
Hi, those are env variables of the platformIO core that the platformIO extension doesn't configure and it left the default values, this PR exposes in the settings UI those env variables that allows enable/disable the telemetry and define the path of many platformIO assets like boards, toolchains, etc. Allowing to change the platformIO installation to other locations like an USB for a portable setup.
The docs of each env variable are:
- https://docs.platformio.org/en/stable/envvars.html#envvar-PLATFORMIO_PLATFORMS_DIR
- https://docs.platformio.org/en/stable/envvars.html#envvar-PLATFORMIO_PACKAGES_DIR
- https://docs.platformio.org/en/stable/envvars.html#envvar-PLATFORMIO_CACHE_DIR
- https://docs.platformio.org/en/stable/envvars.html#envvar-PLATFORMIO_SETTING_PROJECTS_DIR
- https://docs.platformio.org/en/stable/envvars.html#envvar-PLATFORMIO_SETTING_ENABLE_TELEMETRY
This PR adds the capacity to use custom paths for the platforms, packages, cache and projects directories by adding a setting for each of them and a setting to enable or disable telemetry which should solve issue #898.
It works by assigning the configuration value of the environment variables:
In the case of the directories if the configuration has some value it will be assigned to the environment variable but if the configuration is null it won't create the environment variable and platformio will use the default directories.
This ability to use custom paths allows the user use a custom platformio installation like installing plaformio in a USB drive and carry all the platforms and toolchains on the go.
Currently there is some obligatory use of the
%USER%/.platformio
directory for theappstate.json
,homestate.json
files and.cache/tmp
directory but i was able to work from a USB drive without any problem.