Skip to content

Sketch compiling via commandline does not check for valid primary .ino filename #10755

Open
@ArcanoxDragon

Description

@ArcanoxDragon

When the Arduino IDE is invoked via the command line for a Verify or Upload task, such as when an external tool like microsoft/vscode-arduino invokes a build, but the name of the sketch file provided on the command line does not match its containing folder name, the first file from FileUtils.listFiles is used as the "primary" file, resulting in undefined behavior (the order returned by listFiles seems non-deterministic) and apparent obscure bugs such as the one I filed at microsoft/vscode-arduino#1100.

The requirement to have the .ino file match the folder name seems arbitrary and restrictive for command-line compilations when the IDE itself is not being used for development. I developed a simple fix for this on my own branch and plan on filing a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: Bugarduino-builderThe tool used to handle the Arduino sketch compilation processarduino-cliRelated to the arduino-cli tool

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions