IDE 2 uses arduino-cli to do the actual compile, right?
Shouldn't the "verbose compilation" log show the actual arduino-cli command used to do "everything"?
(I see and appreciate that arduino-cli itself is operating in verbose mode and logs the commands that IT issues...)
I could be wrong, but I believe that the IDE does not use the CLI interface, but instead uses a different mechanism, like IPC calls...
This came up in some earlier topics, I don't remember if it was up on this forum or on the PJRC forum, where @ptillisch (PerT on PJRC) described some of this.
I believe the topic was about how to integrate the IDE 2 build process into how some of us were/are build sketches for the Teensy boards within sublime text, such that we would use the same build process as Arduino does, like we do/did for IDE 1.x.
I also remember this was requested before. My impression was that it was in a GitHub issue, but I didn't find anything after some searching in both the arduino/arduino-ide and arduino/arduino-cli issue trackers.
As KurtE said, Arduino IDE does not use the Arduino CLI command line interface. Instead it using the gRPC interface:
https://arduino.github.io/arduino-cli/latest/integration-options/#the-second-pillar-grpc-interface
So the only way this could be accomplished would be for Arduino CLI to print a command line invocation equivalent to the request made by Arduino IDE via the gRPC interface, even though no such invocation was actually used. In some cases, there is no command line equivalent.
I like the idea of users being able to easily reproduce operations performed via the Arduino IDE GUI by copying the arduino-cli commands from the output rather than having to start from scratch to develop such a command. However, I don't think it would be a good idea for Arduino IDE to falsely imply to the user that such a command was actually being invoked.
It is already possible (if less convenient than what you hoped) to get transparency from the IDE about the gRPC communications:
- Press the Ctrl+Shift+P keyboard shortcut (Command+Shift+P for macOS users) to open the "Command Palette".
A menu will appear on the editor toolbar:
- Select the "Preferences: Open Settings (UI)" command from the menu.
ⓘ You can scroll down through the list of commands to find it or type the name in the field.
A "Preferences" tab will open in the Arduino IDE main panel. - Type
arduino.cli.daemon.debugin the "Search Settings" field of the "Preferences" tab. - Check the box under the "Arduino › Cli: Daemon: Debug" setting.
- Close the Preferences tab by clicking its X icon.
- Select File > Quit from the Arduino IDE menus.
- Start Arduino IDE.
ⓘ As documented in the "Arduino › Cli: Daemon: Debug" setting description, this restart is required in order to cause the IDE to recognize the change to the setting. - Perform whatever actions you want to get insight into.
The gRPC communications will be logged to the file at this location:
Linux
If XDG_CONFIG_HOME is set:
${XDG_CONFIG_HOME}/Arduino IDE
Otherwise:
/home/<username>/.config/Arduino IDE/
(where <username> is your Linux username)
macOS
/Users/<username>/Library/Logs/Arduino IDE/
(where <username> is your macOS username)
The Library folder is hidden by default. You can make it visible by pressing the Command+Shift+. keyboard shortcut.
Windows
C:\Users\<username>\AppData\Roaming\Arduino IDE\
(where <username> is your Windows username)
ⓘ Note that the C:\Users\<username>\AppData folder is hidden by default. On Windows "File Explorer", you can make it visible by opening the "View" menu, then checking the box next to "☐ Hidden items".
Note that the IDE produces a much larger quantity of logs when you have the "Arduino › Cli: Daemon: Debug" setting enabled. I recommend disabling any time you don't need that additional information in the logs.
Ah. I had read that IDE2 uses arduino-cli; I hadn't realized that there was a non-cli interface to it. Thanks for the explanation!
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
