Skip to content

ARDUINO_USER_AGENT environment variable not set #2318

Closed
@PaulStoffregen

Description

@PaulStoffregen

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

Activity

kittaakos

kittaakos commented on Jan 15, 2024

@kittaakos
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

PaulStoffregen commented on Jan 16, 2024

@PaulStoffregen
SponsorAuthor

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?

added a commit that references this issue on Jan 16, 2024
8c784b4
kittaakos

kittaakos commented on Jan 17, 2024

@kittaakos
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

PaulStoffregen commented on Jan 17, 2024

@PaulStoffregen
SponsorAuthor

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

kittaakos commented on Jan 17, 2024

@kittaakos
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

PaulStoffregen commented on Jan 17, 2024

@PaulStoffregen
SponsorAuthor

I built the modified teensy_size for MacOS.

added a commit that references this issue on Jan 17, 2024
b8dd39c
kittaakos

kittaakos commented on Jan 17, 2024

@kittaakos
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

PaulStoffregen commented on Jan 18, 2024

@PaulStoffregen
SponsorAuthor

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @PaulStoffregen@kittaakos

      Issue actions

        ARDUINO_USER_AGENT environment variable not set · Issue #2318 · arduino/arduino-ide