- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 432
Open
Labels
topic: codeRelated to content of the project itselfRelated to content of the project itselftype: imperfectionPerceived defect in any part of projectPerceived defect in any part of project
Description
Describe the problem
If I have a sketch with compiler errors, as a user of the CLI, I would expect the order of the errors is deterministic. It does not.
To reproduce
- Download and extract the attached Errors.zipsketch somewhere. 👆
- Compile with the CLI:
% ~/Downloads/arduino-cli compile -b arduino:mbed_nano:nanorp2040connect ~/Documents/Arduino/Errors
In file included from /Users/a.kitta/Documents/Arduino/Errors/CppTab.cpp:1:0:
/Users/a.kitta/Documents/Arduino/Errors/HTab.h:1:1: error: 'bazerror' does not name a type
 bazerror;
 ^~~~~~~~
/Users/a.kitta/Documents/Arduino/Errors/CppTab.cpp: In function 'void qux()':
/Users/a.kitta/Documents/Arduino/Errors/CppTab.cpp:3:3: error: 'quxerror' was not declared in this scope
   quxerror
   ^~~~~~~~
/Users/a.kitta/Documents/Arduino/Errors/CTab.c: In function 'pluto':
/Users/a.kitta/Documents/Arduino/Errors/CTab.c:2:3: error: 'plutoerror' undeclared (first use in this function); did you mean 'pluto'?
   plutoerror
   ^~~~~~~~~~
   pluto
/Users/a.kitta/Documents/Arduino/Errors/CTab.c:2:3: note: each undeclared identifier is reported only once for each function it appears in
/Users/a.kitta/Documents/Arduino/Errors/CTab.c:3:1: error: expected ';' before '}' token
 }
 ^
In file included from /Users/a.kitta/Documents/Arduino/Errors/Errors.ino:1:0:
/Users/a.kitta/Documents/Arduino/Errors/src/HFile.h:1:1: error: 'paperinoerror' does not name a type
 paperinoerror;
 ^~~~~~~~~~~~~
/Users/a.kitta/Documents/Arduino/Errors/Errors.ino: In function 'void setup()':
/Users/a.kitta/Documents/Arduino/Errors/Errors.ino:3:3: error: 'fooerror' was not declared in this scope
   fooerror
   ^~~~~~~~
/Users/a.kitta/Documents/Arduino/Errors/Errors.ino:3:3: note: suggested alternative: 'ferror'
   fooerror
   ^~~~~~~~
   ferror
/Users/a.kitta/Documents/Arduino/Errors/Errors.ino: In function 'void loop()':
/Users/a.kitta/Documents/Arduino/Errors/Errors.ino:6:3: error: 'barerror' was not declared in this scope
   barerror
   ^~~~~~~~
/Users/a.kitta/Documents/Arduino/Errors/Errors.ino:6:3: note: suggested alternative: 'strerror'
   barerror
   ^~~~~~~~
   strerror
/Users/a.kitta/Documents/Arduino/Errors/InoTab.ino: In function 'void pippo()':
/Users/a.kitta/Documents/Arduino/Errors/InoTab.ino:2:3: error: 'pippoerror' was not declared in this scope
   pippoerror
   ^~~~~~~~~~
/Users/a.kitta/Documents/Arduino/Errors/InoTab.ino:2:3: note: suggested alternative: 'perror'
   pippoerror
   ^~~~~~~~~~
   perror
Used platform     Version Path                                                                      
arduino:mbed_nano 3.1.1   /Users/a.kitta/Library/Arduino15/packages/arduino/hardware/mbed_nano/3.1.1
Error during build: exit status 1
- Without doing anything, repeat the previous step:
% ~/Downloads/arduino-cli compile -b arduino:mbed_nano:nanorp2040connect ~/Documents/Arduino/Errors
/Users/a.kitta/Documents/Arduino/Errors/CTab.c: In function 'pluto':
/Users/a.kitta/Documents/Arduino/Errors/CTab.c:2:3: error: 'plutoerror' undeclared (first use in this function); did you mean 'pluto'?
   plutoerror
   ^~~~~~~~~~
   pluto
/Users/a.kitta/Documents/Arduino/Errors/CTab.c:2:3: note: each undeclared identifier is reported only once for each function it appears in
/Users/a.kitta/Documents/Arduino/Errors/CTab.c:3:1: error: expected ';' before '}' token
 }
 ^
In file included from /Users/a.kitta/Documents/Arduino/Errors/CppTab.cpp:1:0:
/Users/a.kitta/Documents/Arduino/Errors/HTab.h:1:1: error: 'bazerror' does not name a type
 bazerror;
 ^~~~~~~~
/Users/a.kitta/Documents/Arduino/Errors/CppTab.cpp: In function 'void qux()':
/Users/a.kitta/Documents/Arduino/Errors/CppTab.cpp:3:3: error: 'quxerror' was not declared in this scope
   quxerror
   ^~~~~~~~
In file included from /Users/a.kitta/Documents/Arduino/Errors/Errors.ino:1:0:
/Users/a.kitta/Documents/Arduino/Errors/src/HFile.h:1:1: error: 'paperinoerror' does not name a type
 paperinoerror;
 ^~~~~~~~~~~~~
/Users/a.kitta/Documents/Arduino/Errors/Errors.ino: In function 'void setup()':
/Users/a.kitta/Documents/Arduino/Errors/Errors.ino:3:3: error: 'fooerror' was not declared in this scope
   fooerror
   ^~~~~~~~
/Users/a.kitta/Documents/Arduino/Errors/Errors.ino:3:3: note: suggested alternative: 'ferror'
   fooerror
   ^~~~~~~~
   ferror
/Users/a.kitta/Documents/Arduino/Errors/Errors.ino: In function 'void loop()':
/Users/a.kitta/Documents/Arduino/Errors/Errors.ino:6:3: error: 'barerror' was not declared in this scope
   barerror
   ^~~~~~~~
/Users/a.kitta/Documents/Arduino/Errors/Errors.ino:6:3: note: suggested alternative: 'strerror'
   barerror
   ^~~~~~~~
   strerror
/Users/a.kitta/Documents/Arduino/Errors/InoTab.ino: In function 'void pippo()':
/Users/a.kitta/Documents/Arduino/Errors/InoTab.ino:2:3: error: 'pippoerror' was not declared in this scope
   pippoerror
   ^~~~~~~~~~
/Users/a.kitta/Documents/Arduino/Errors/InoTab.ino:2:3: note: suggested alternative: 'perror'
   pippoerror
   ^~~~~~~~~~
   perror
Used platform     Version Path                                                                      
arduino:mbed_nano 3.1.1   /Users/a.kitta/Library/Arduino15/packages/arduino/hardware/mbed_nano/3.1.1
Error during build: exit status 1
First error with the first compile command:
/Users/a.kitta/Documents/Arduino/Errors/HTab.h:1:1: error: 'bazerror' does not name a type
First error with the second compile attempt:
/Users/a.kitta/Documents/Arduino/Errors/CTab.c:2:3: error: 'plutoerror' undeclared (first use in this function); did you mean 'pluto'?
Expected behavior
No matter how many times I compile the same broken sketch, the output on the stderr is the same.
Arduino CLI version
Version: nightly-20220614 Commit: 76fab32 Date: 2022-06-14T08:23:46Z
Operating system
macOS
Operating system version
12.3.1
Additional context
No response
Issue checklist
- I searched for previous reports in the issue tracker
- I verified the problem still occurs when using the nightly build
- My report contains all necessary details
Metadata
Metadata
Assignees
Labels
topic: codeRelated to content of the project itselfRelated to content of the project itselftype: imperfectionPerceived defect in any part of projectPerceived defect in any part of project