Skip to content
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

--verify with relative filename does not work #5836

Closed
matthijskooijman opened this issue Jan 11, 2017 · 1 comment · Fixed by #5878
Closed

--verify with relative filename does not work #5836

matthijskooijman opened this issue Jan 11, 2017 · 1 comment · Fixed by #5878
Assignees
Labels
Type: Bug Type: Regression Something that used to work and now doesn't

Comments

@matthijskooijman
Copy link
Collaborator

It seems that specifying a relative filename to the sketch does not work with --verify. I suspect this worked before and was broken in the recent refactor to remove GUI dependencies from the CLI invocation.

To reproduce, just call arduino with a plain filename (it does not matter if the file/sketch exists or not), like:

$ arduino --verify foo.ino
Picked up JAVA_TOOL_OPTIONS:
Loading configuration...
Initializing packages...
Preparing boards...
Verifying...
java.lang.NullPointerException
        at processing.app.helpers.FileUtils.listFiles(FileUtils.java:348)
        at processing.app.Sketch.listSketchFiles(Sketch.java:108)
        at processing.app.Sketch.<init>(Sketch.java:54)
        at processing.app.Base.<init>(Base.java:381)
        at processing.app.Base.main(Base.java:140)

Note that the above has the following patch applied, since the --verify handling code currently eats up exceptions without showing them (which also makes things fail without error when a full path to a non-existent sketch is passed). This should also be fixed.

--- a/app/src/processing/app/Base.java
         outputFile = new Compiler(sketch).build(progress -> {}, false);
       } catch (Exception e) {

         // Error during build
-        System.exit(1);
+        throw(e);
       }

Furthermore, passing a full filename works:

$ arduino --verify $(pwd)/foo.ino
(output hidden)

Without --verify, a relative pathname works as expected and loads the sketch in the GUI without complaints:

$ arduino foo.ino
@facchinm facchinm added Type: Bug Type: Regression Something that used to work and now doesn't labels Jan 11, 2017
@brandoncurtis
Copy link

Can confirm that this is a problem in 1.8.0 and 1.8.1 on Debian Jessie and Ubuntu 16.04, that it breaks arduino --upload, that it fails silently, and that passing a full path still works. This problem doesn't appear in 1.6.13. Adding CLI uploading to the unit tests could prevent regressions like this one.

cmaglie added a commit to cmaglie/Arduino that referenced this issue Jan 19, 2017
cmaglie added a commit to cmaglie/Arduino that referenced this issue Jan 19, 2017
@ghost ghost added the in progress Work on this item is in progress label Jan 19, 2017
@ghost ghost removed the in progress Work on this item is in progress label Jan 23, 2017
cmaglie added a commit that referenced this issue Jan 23, 2017
gyungdal added a commit to gyungdal/Flow-measurement that referenced this issue May 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Type: Regression Something that used to work and now doesn't
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants