Skip to content

ARDUINO_USER_AGENT environment variable not set #2499

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

Closed
3 tasks done
PaulStoffregen opened this issue Jan 13, 2024 · 2 comments · Fixed by #2501
Closed
3 tasks done

ARDUINO_USER_AGENT environment variable not set #2499

PaulStoffregen opened this issue Jan 13, 2024 · 2 comments · Fixed by #2501
Assignees
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@PaulStoffregen
Copy link

PaulStoffregen commented Jan 13, 2024

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.

arduino/arduino-ide#2318

image

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
@PaulStoffregen PaulStoffregen added the type: imperfection Perceived defect in any part of project label Jan 13, 2024
@per1234 per1234 added the topic: code Related to content of the project itself label Jan 13, 2024
@PaulStoffregen
Copy link
Author

PaulStoffregen commented Jan 15, 2024

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.

@PaulStoffregen
Copy link
Author

Tested 0.35.1 just now, can confirm it solves this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants