Skip to content

Incorrect compiler error when using --source-override #1185

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
kittaakos opened this issue Feb 12, 2021 · 0 comments
Open

Incorrect compiler error when using --source-override #1185

kittaakos opened this issue Feb 12, 2021 · 0 comments
Assignees
Labels
topic: build-process Related to the sketch build process topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@kittaakos
Copy link
Contributor

kittaakos commented Feb 12, 2021

Bug Report

This is a follow-up of #1099.

Current behavior

--source-override generates an incorrect compiler error.

Actual:

 % ls -al
total 16
drwxr-xr-x   4 akos.kitta  staff   128 Feb 12 13:33 .
drwxr-xr-x@ 51 akos.kitta  staff  1632 Feb 12 13:32 ..
-rw-r--r--   1 akos.kitta  staff    96 Feb 12 13:37 overrides.json
-rw-r--r--   1 akos.kitta  staff    30 Feb 12 13:36 sketch_override.ino
 % cat sketch_override.ino 
void setup() {}
void loop() {}%                                                                                                                                                             
 % cat overrides.json 
{
    "overrides": {
        "sketch_override.ino": "foovoid setup() {}\nvoid loop() {}"
    }
}%                                                                                                                                                                          
 % arduino-cli compile -b arduino:avr:uno --source-override overrides.json
/Users/akos.kitta/Desktop/sketch_override/sketch_override.ino:1:1: error: 'foovoid' does not name a type; did you mean 'void'?
 void setup() {}
 ^~~~~~~
 void
/Users/akos.kitta/Desktop/sketch_override/sketch_override.ino:1:1: error: 'foovoid' does not name a type; did you mean 'void'?
 void setup() {}
 ^~~~~~~
 void

Error during build: exit status 1
 % 

Expected:

 % ls -al
total 16
drwxr-xr-x   4 akos.kitta  staff   128 Feb 12 13:33 .
drwxr-xr-x@ 51 akos.kitta  staff  1632 Feb 12 13:32 ..
-rw-r--r--   1 akos.kitta  staff    96 Feb 12 13:37 overrides.json
-rw-r--r--   1 akos.kitta  staff    30 Feb 12 13:36 sketch_override.ino
 % cat sketch_override.ino 
void setup() {}
void loop() {}%                                                                                                                                                             
 % cat overrides.json 
{
    "overrides": {
        "sketch_override.ino": "foovoid setup() {}\nvoid loop() {}"
    }
}%                                                                                                                                                                          
 % arduino-cli compile -b arduino:avr:uno --source-override overrides.json
/Users/akos.kitta/Desktop/sketch_override/sketch_override.ino:1:1: error: 'foovoid' does not name a type; did you mean 'void'?
 foovoid setup() {}
 ^~~~~~~
 void
/Users/akos.kitta/Desktop/sketch_override/sketch_override.ino:1:1: error: 'foovoid' does not name a type; did you mean 'void'?
 foovoid setup() {}
 ^~~~~~~
 void
Error during build: exit status 1
 % 

Environment

  • CLI version (output of arduino-cli version): 0.34.2
  • OS and platform: all

Additional context

@per1234 per1234 reopened this Mar 30, 2021
@fstasi fstasi removed the type: bug label Sep 16, 2021
@rsora rsora added type: imperfection Perceived defect in any part of project topic: core labels Sep 22, 2021
@per1234 per1234 added the topic: code Related to content of the project itself label Dec 1, 2021
@umbynos umbynos added the topic: build-process Related to the sketch build process label Nov 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: build-process Related to the sketch build process topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

7 participants