Description
Describe the request
Allow advanced users to cause the instances of Arduino CLI used by Arduino IDE to be configured via a configuration file from any arbitrary path.
🙂 This will significantly facilitate certain advanced use cases.
Describe the current behavior
Many of the non-GUI capabilities of Arduino IDE are provided by the Arduino CLI tool.
Arduino CLI is configured via a configuration file. When Arduino IDE invokes Arduino CLI, it specifies the use of the configuration file from a specific hardcoded path:
arduino-ide/arduino-ide-extension/src/node/arduino-daemon-impl.ts
Lines 132 to 133 in 0f9f0d0
This hardcoded path is $HOME/.arduinoIDE/arduino-cli.yaml
.
For some advanced use cases, the location under the user home directory is very inconvenient:
- Institutional installations where the system administrator wishes a single configuration to be used by all users
- "Portable" use cases where the user wants to carry a self-contained installation of Arduino IDE and project dependencies on a portable drive for use on any computer.
- Having a dedicated configuration and dependencies environment for each specific project.
🙁 The user either cannot achieve their desired use case, or is forced to use inconvenient and convoluted means to do so.
Arduino IDE version
Operating system
- Linux
- macOS
- Windows
Operating system version
- Ubuntu 24.04
- macOS Sequoia
- Windows 11
Additional context
This is a capability that is only required by advanced users, so it is not necessary to provide the capability in a beginner friendly manner. The complexity of Arduino IDE's primary UI MUST NOT be increased through the implementation of this feature. It is perfectly fine for the configuration to only be available through an environment variable or command line flag.
There are a couple of possibilities by which this might be accomplished:
Allow the user to set the Arduino IDE configuration folder path
The hardcoded location for the Arduino CLI configuration file used by Arduino IDE is under the Arduino IDE configuration folder (i.e., $HOME/.arduinoIDE
), so if the Arduino IDE configuration folder location was made configurable, this would also make the Arduino CLI configuration file location configurable.
The Eclipse Theia Platform IDE framework upon which Arduino IDE is built already has the capability for the user to set an arbitrary configuration folder location via the THEIA_CONFIG_DIR
environment variable:
protected async createConfigDirUri(): Promise<string> {
if (process.env.THEIA_CONFIG_DIR) {
// this has been explicitly set by the user, so we do not override its value
return FileUri.create(process.env.THEIA_CONFIG_DIR).toString();
}
However, that system is overridden in the Arduino IDE codebase:
join(homedir(), BackendApplicationConfigProvider.get().configDirName)
I believe the reason for this override was that, at the time it was implemented, Theia hardcoded the default configuration folder path as $HOME/.theia
and we wanted a folder name that matches the application. However, the ability for each application to configure a custom default configuration folder name has since been added to Theia:
So there is now no point in us maintaining the override code in this project.
Respect the ARDUINO_CONFIG_FILE
environment variable
Arduino CLI supports specifying the configuration file location via an environment variable:
https://arduino.github.io/arduino-cli/dev/configuration/#locations
The configuration file is searched in the following locations, in order of priority:
- Location specified by the
--config-file
command line flag- Location specified by the
ARDUINO_CONFIG_FILE
environment variable
Arduino IDE's use of the --config-file
flag in the arduino-cli daemon
invocation makes it impossible for the user to configure the path via the ARDUINO_CONFIG_FILE
environment variable. This could be allowed if Arduino IDE checked whether the ARDUINO_CONFIG_FILE
environment variable was set, and if so omitted the --config-file
command line flag from the invocation (and also using that path if it does any direct access of the configuration file).
Additional requests
- https://forum.arduino.cc/t/arduino-ide-2-0-portable/1031833/20
- https://forum.arduino.cc/t/arduino-ide-2-0-portable/1031833/23
- https://forum.arduino.cc/t/arduino-ide-2-0-portable/1031833/24
- https://forum.arduino.cc/t/shared-libraries-on-a-classroom-pc-windows/1157040
- https://forum.arduino.cc/t/change-board-package-folder-for-shared-access/1231038
- https://forum.arduino.cc/t/where-could-we-find-arduino-code-source-in-ide-v2-x/1347261/14
- https://forum.arduino.cc/t/arduinoide-2-3-6-silent-with-libs-for-all-users/1380305
- https://forum.arduino.cc/t/binary-filenames-contain-ino/1384989/5
Related
- Add a portable mode #122
- https://forum.arduino.cc/t/arduino-ide-2-0-rc-silent-install/960245/12
- https://forum.arduino.cc/t/arduino-ide-2-2-1-request-for-administrative-privileges-on-first-run/1212198
- https://forum.arduino.cc/t/platform-tools-in-to-install-directory/1271985
- https://forum.arduino.cc/t/arduino-2-x-in-the-classroom/1296515
- https://forum.arduino.cc/t/compile-error-permissions-denied-for-student-user/1377240
Keywords
-
"configuration directory"
Issue checklist
- I searched for previous requests in the issue tracker
- I verified the feature was still missing when using the latest nightly build
- My request contains all necessary details