ARDUINO_USER_AGENT environment variable not set
PaulStoffregen opened this issue · comments
Describe the problem
Arduino CLI 0.36.0-rc.1 is not setting the ARDUINO_USER_AGENT environment variable when running tools.
To reproduce
Using Linux x86-64:
1: Install Teensy package 0.59.4
2: Copy this modified teensy_size tool to ~/.arduino15/packages/teensy/tools/teensy-tools/0.59.4/
3: Compile any sketch with FQBN "teensy:avr:teensy40" and look for "ARDUINO_USER_AGENT = " in the output.
This copy of teensy_size prints the ARDUINO_USER_AGENT environment variable to stdout. When run, you will see it prints (null).
./arduino-cli compile -b teensy:avr:teensy40 ~/.arduino15/packages/teensy/hardware/avr/0.59.4/libraries/_Teensy/examples/Serial/EchoBoth/EchoBoth.ino
ARDUINO_USER_AGENT = (null)
Used platform Version Path
teensy:avr 0.59.4 /home/paul/.arduino15/packages/teensy/hardware/avr/0.59.4
To install Teensy package 0.59.4 using Arduino IDE 2.2.1:
1: File - Preferences, add Teensy URL https://www.pjrc.com/teensy/td_download.html
2: In Boards Manager, search "teensy".
3: Select 0.59.4 from drop-down list and click install.
Expected behavior
The ARDUINO_USER_AGENT environment variable is supposed to be set, according to the Platform Specification, under "Environment variables":
https://arduino.github.io/arduino-cli/0.35/platform-specification/#environment-variables
Running this with Arduino CLI 0.34.2 prints a correct ARDUINO_USER_AGENT.
arduino-cli compile -b teensy:avr:teensy40 ~/.arduino15/packages/teensy/hardware/avr/0.59.4/libraries/_Teensy/examples/Serial/EchoBoth/EchoBoth.ino
ARDUINO_USER_AGENT = arduino-cli/0.34.2
Used platform Version Path
teensy:avr 0.59.4 /home/paul/.arduino15/packages/teensy/hardware/avr/0.59.4
Arduino CLI version
arduino-cli Version: 0.36.0-rc.1 Commit: 31e0341 Date: 2024-01-11T12:36:53Z
Operating system
Linux
Operating system version
Ubuntu 22.04
Additional context
This problem also happens with recent Arduino IDE night builds.
Issue checklist
- I searched for previous reports in the issue tracker
- I verified the problem still occurs when using the nightly build
- My report contains all necessary details
Teensy's software depends on ARDUINO_USER_AGENT.
Really hoping this can be fixed before the next IDE release, because without ARDUINO_USER_AGENT my software believes it is running from Arduino IDE 1.8.19.
Tested 0.35.1 just now, can confirm it solves this issue.