Skip to content

Not using same compile defaults as arduino-cli #344

Open
@MallocArray

Description

@MallocArray

Describe the problem

With several sketches I can compile them using Arduino IDE or arduino-cli successfully with no errors, but when using compile-sketches with the same settings as far as I can tell, I get messages about unused functions and variables. Of course, I could/should have those cleaned up, but wasn't even aware they were there since other methods of compiling don't show it by default.

Looking at the help for arduino-cli compile --help it shows that --warnings is optional and defaults to none, but compile-sketches seems to default to default which does show these unused messages. I didn't see this documented in the readme file anywhere and it took a decent amount of time to figure out how to even get the same messages locally so I could figure out how to suppress the messages in compile-sketches

Ultimately, I can suppress it by adding:

          cli-compile-flags: |
            - --warnings
            - none

But I would have expected compile-sketches to use the same defaults as arduino-cli does, which does not appear to be the case currently, unless there is another setting in my particular config that is changing the behavior

To reproduce

Workflow file without overriding default behavior for warnings:
https://github.com/MallocArray/arduino/blob/bdf3466f04b5eb6cac9be5bf64f7a84b05e99cf2/.github/workflows/check2.yml

This results in a failure of the workflow action:
https://github.com/MallocArray/arduino/actions/runs/12951761541/job/36127521057

Explicitly setting the cli-compile-flags to set warnings to none suppresses the message and results in the workflow action completing successfully as it does with Arduino IDE and arduino-cli
https://github.com/MallocArray/arduino/blob/be9d95051fae0004a7708fbbebb85a861a3fc617/.github/workflows/check2.yml
https://github.com/MallocArray/arduino/actions/runs/12941225109/job/36096919090

Expected behavior

No warning messages about unused variables or functions which is the same as the defaults for Arduino IDE and arduino-cli

'arduino/compile-sketches' version

1.1.2

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 version
  • My report contains all necessary details

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: imperfectionPerceived defect in any part of project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions