Skip to content

Unexpected output filenames when local sketch file is used as compile argument #691

Closed
@per1234

Description

@per1234

Bug Report

Current behavior

If I run arduino-cli compile from the sketch folder and pass the sketch file name as the argument:

arduino-cli compile --fqbn arduino:avr:uno Foo.ino

or

arduino-cli compile --fqbn arduino:avr:uno ./Foo.ino

the component of the output file name that is expected to be the sketch name (Foo) is instead .:

Foo
|_ ..arduino.avr.uno.elf
|_ ..arduino.avr.uno.hex
|_ ..arduino.avr.uno.with_bootloader.hex
|_ Foo.ino

I haven't found this to actually cause a problem; it's just not the behavior I expect. Not a big deal, but I thought I should report it anyway.

The issue does not occur if I use the absolute path to the file, or the relative path to the file when the command is run from outside the sketch folder.

The issue does not occur at b62c339 so it was introduced by 6718cf4. I notice the same thing occurs even with previous versions of Arduino CLI when you ran arduino-cli compile --fqbn arduino:avr:uno ./.

Of course, it's not necessary to provide the sketch argument when the command is run from the sketch folder, but I do think users will be likely to do this. I encountered this issue while testing to see if #355 (comment) had been resolved by #690, which is a report of this usage. #51 (comment) is another.

Examples of the same use pattern with arduino-cli upload (which turns out to actually cause an error):

Expected behavior

arduino-cli compile --fqbn arduino:avr:uno Foo.ino should result in output file names that start with Foo.arduino.avr.uno.

Environment

  • CLI version (output of arduino-cli version): 0.10.0-rc1 Commit: 6718cf4
  • OS and platform: Windows, Linux 64 bit

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions