Skip to content
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

ARDUINO_USER_AGENT environment variable not set #2318

Closed
3 tasks done
PaulStoffregen opened this issue Dec 28, 2023 · 8 comments · Fixed by #2332
Closed
3 tasks done

ARDUINO_USER_AGENT environment variable not set #2318

PaulStoffregen opened this issue Dec 28, 2023 · 8 comments · Fixed by #2332
Labels
conclusion: resolved Issue was resolved topic: CLI Related to Arduino CLI type: imperfection Perceived defect in any part of project

Comments

@PaulStoffregen
Copy link

PaulStoffregen commented Dec 28, 2023

Describe the problem

Latest IDE nightly builds are not setting the ARDUINO_USER_AGENT environment variable when running tools.

To reproduce

Using Linux x86-64:

1: File - Preferences, add Teensy URL https://www.pjrc.com/teensy/package_teensy_index.json
2: Boards Manager, Install Teensy 0.59.4
3: Copy this modified teensy_size tool to ~/.arduino15/packages/teensy/tools/teensy-tools/0.59.4/
4: Click Verify and look for "ARDUINO_USER_AGENT = " in the output panel.

image

Alternately, edit the source code for any tool to print the ARDUINO_USER_AGENT environment variable. This copy of teensy_size merely has these lines added:

      const char *ardua = getenv("ARDUINO_USER_AGENT");
      fprintf(stderr, "ARDUINO_USER_AGENT = %s\n", ardua);

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

Arduino IDE 2.2.1 does it correctly:

image

Arduino IDE version

arduino-ide_nightly-20231227_Linux_64bit

Operating system

Linux

Operating system version

Ubuntu 22.04

Additional context

No response

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details
@PaulStoffregen PaulStoffregen added the type: imperfection Perceived defect in any part of project label Dec 28, 2023
@kittaakos kittaakos added the topic: CLI Related to Arduino CLI label Jan 15, 2024
@kittaakos
Copy link
Contributor

Thank you for reporting it

Latest IDE nightly builds are not setting the ARDUINO_USER_AGENT environment variable

IDE2 has never set any environment variables. I see this is an issue in the CLI: arduino/arduino-cli#2499. I keep this issue open for visibility.

@PaulStoffregen
Copy link
Author

I tested the new CLI 0.35.1 release just now. Can confirm it defines ARDUINO_USER_AGENT.

Will test IDE nightly builds to confirm here. Hopefully nightly builds have CLI 0.35.1 soon?

kittaakos pushed a commit that referenced this issue Jan 16, 2024
Closes #2318

Signed-off-by: Akos Kitta <[email protected]>
@kittaakos
Copy link
Contributor

3: Copy this modified teensy_size tool to ~/.arduino15/packages/teensy/tools/teensy-tools/0.59.4/

@PaulStoffregen, can you provide a link to the modified tool for macOS (Intel)? I want to verify #2332.

  • I downloaded the tool,
  • copied it to the desired location (on macOS /Users/a.kitta/Library/Arduino15/packages/teensy/tools/teensy-tools/0.59.4),
  • changed the permissions (chmod +x)

I got this error when compiling in IDE2:

fork/exec /Users/a.kitta/Library/Arduino15/packages/teensy/tools/teensy-tools/0.59.4/teensy_size: exec format error

Compilation error: fork/exec /Users/a.kitta/Library/Arduino15/packages/teensy/tools/teensy-tools/0.59.4/teensy_size: exec format error

Thank you!

@PaulStoffregen
Copy link
Author

Will build a MacOS copy in several hours. Right now I have a Windows test machine set up on my workbench. Need to first wrap up this work with Windows before I can put it away and set up my Mac.

@kittaakos
Copy link
Contributor

Will build a MacOS copy in several hours.

You don't need to. Thank you! You've already helped a lot by checking the build from the PR (#2332 (comment)).

I've set up my Linux env and will go ahead with the already attached binary for Linux.

@PaulStoffregen
Copy link
Author

I built the modified teensy_size for MacOS.

kittaakos pushed a commit that referenced this issue Jan 17, 2024
Closes #2318

Signed-off-by: Akos Kitta <[email protected]>
@kittaakos kittaakos added the conclusion: resolved Issue was resolved label Jan 17, 2024
@kittaakos
Copy link
Contributor

I built the modified teensy_size for MacOS.

Thank you! I have verified it on macOS:

Before:

Screenshot 2024-01-17 at 17 35 50

After:

Screenshot 2024-01-17 at 17 36 29

@PaulStoffregen
Copy link
Author

Final followup to confirm nightly build now has this issue fixed.

image

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: CLI Related to Arduino CLI type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants