Skip to content

1.6.12 Path+Sketch length error / Could not create sketch / Failed to open sketch / Only showing include files #5431

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

Closed
degerrit opened this issue Sep 30, 2016 · 5 comments
Assignees
Labels
editor-refactor Related to the refactoring of the Arduino IDE's editor component

Comments

@degerrit
Copy link

degerrit commented Sep 30, 2016

Not sure why this issue appeared (maybe I moved the Arduino sketch folder - I hadn't used my Arduino in a few months), but my Arduino IDE on Windows is now having issues with Sketches that have long path+filenames. I created these in Arduino IDE, so previously I had no issues with this.

Other programs, i.e. Wordpad, can open the .ino files without any problems, so it's not an OS limitation.

Examples:
D:\Blink_undDet-D8_Water-A0_Temp-D2_X10RF-D4_LDR-A1\Blink_undDet-D8_Water-A0_Temp-D2_X10RF-D4_LDR-A1.ino
105 chars - result: opens OK

D:\Blink_undDet-D8_Water-A0_Temp-D2_X10RF-D4_LDR-A1_Dist12_13_8s_s\Blink_undDet-D8_Water-A0_Temp-D2_X10RF-D4_LDR-A1_Dist12_13_8s_s.ino
135 chars - result: Not OK, "Could not create sketch"

Interestingly, the first sketch I opened after upgrading to 1.6.12 had some include files with short filenames (x10rf.h, x10rf.cpp) - the result here is NO ERROR MESSAGE, but the IDE opening only the include files, and not the .ino file.

A full downgrade back to 1.6.9 (uninstall/reinstall) fixes the issue.

Default path - looks OK:

arduino_ide_bugreport_longpath_05_default_path_ok

Wordpad - no issue:

arduino_ide_bugreport_longpath_03_wordpad_no_issue

The long path

arduino_ide_bugreport_longpath_01

Long (>128 character?) .INO sketch file that contains include files - IDE only shows the short include files, NO ERROR message is given

arduino_ide_bugreport_longpath_02_includes_load_but_not_ino_file

Short test sketch with no includes, but long path - ERROR

arduino_ide_bugreport_longpath_06_used_blink_no_includes_results_in_errormsg


arduino_ide_bugreport_longpath_06b_used_blink_no_includes_results_in_errormsg


arduino_ide_bugreport_longpath_06c_used_blink_no_includes_results_in_errormsg_moved_also

Same sketch, renamed / shortened path and Sketch name - opens OK

arduino_ide_bugreport_longpath_07_shortened_name_ok

@degerrit degerrit changed the title Path+Sketch length error / Could not create sketch / Failed to open sketch / Only showing include files 1.6.12 Path+Sketch length error / Could not create sketch / Failed to open sketch / Only showing include files Oct 1, 2016
@degerrit
Copy link
Author

degerrit commented Oct 1, 2016

Updated my original bug, a downgrade to 1.6.9 via full uninstall/reinstall resolves the problem.
Previously my downgrade to 1.6.9 that didn't resolve the problem involved swapping the Arduino folder for a backed-up folder, not a full uninstall/reinstall. Very strange!

@degerrit
Copy link
Author

degerrit commented Oct 1, 2016

OK, 1.6.11 also does not have this problem. Maybe it's the editor code refactoring in 1.6.12

@facchinm facchinm added the editor-refactor Related to the refactoring of the Arduino IDE's editor component label Oct 3, 2016
@cmaglie cmaglie closed this as completed in 653a052 Oct 3, 2016
@cmaglie cmaglie added this to the Release 1.6.13 milestone Oct 3, 2016
@cmaglie
Copy link
Member

cmaglie commented Oct 3, 2016

Thanks for the bug report.

In this case is not the full path length the problem, but only the sketch name length.

The sketch name is limited to 63 chars and this limit has always been there but, before 1.6.12, the check was made only on the sketch name without the .ino extension. After 1.6.12 this check has been changed to test the full file name (with .ino extension). So a sketch that previously fitted exactly the 63 chars limit after 1.6.12 it will suddenly became invalid because the .ino extension will made it of 64+4 -> 67.

Now I've fixed it by making the check again on the sketch name. Of course this bug affects only sketch with very long names (nearing 63 chars).

@Lizews2006
Copy link

Not sure why this issue appeared (maybe I moved the Arduino sketch folder - I hadn't used my Arduino in a few months), but my Arduino IDE on Windows is now having issues with Sketches that have long path+filenames. I created these in Arduino IDE, so previously I had no issues with this.

Other programs, i.e. Wordpad, can open the .ino files without any problems, so it's not an OS limitation.

Examples:
D:\Blink_undDet-D8_Water-A0_Temp-D2_X10RF-D4_LDR-A1\Blink_undDet-D8_Water-A0_Temp-D2_X10RF-D4_LDR-A1.ino
105 chars - result: opens OK

D:\Blink_undDet-D8_Water-A0_Temp-D2_X10RF-D4_LDR-A1_Dist12_13_8s_s\Blink_undDet-D8_Water-A0_Temp-D2_X10RF-D4_LDR-A1_Dist12_13_8s_s.ino
135 chars - result: Not OK, "Could not create sketch"

Interestingly, the first sketch I opened after upgrading to 1.6.12 had some include files with short filenames (x10rf.h, x10rf.cpp) - the result here is NO ERROR MESSAGE, but the IDE opening only the include files, and not the .ino file.

A full downgrade back to 1.6.9 (uninstall/reinstall) fixes the issue.

Default path - looks OK:

arduino_ide_bugreport_longpath_05_default_path_ok

Wordpad - no issue:

arduino_ide_bugreport_longpath_03_wordpad_no_issue

The long path

arduino_ide_bugreport_longpath_01

Long (>128 character?) .INO sketch file that contains include files - IDE only shows the short include files, NO ERROR message is given

arduino_ide_bugreport_longpath_02_includes_load_but_not_ino_file

Short test sketch with no includes, but long path - ERROR

arduino_ide_bugreport_longpath_06_used_blink_no_includes_results_in_errormsg

arduino_ide_bugreport_longpath_06b_used_blink_no_includes_results_in_errormsg

arduino_ide_bugreport_longpath_06c_used_blink_no_includes_results_in_errormsg_moved_also

Same sketch, renamed / shortened path and Sketch name - opens OK

arduino_ide_bugreport_longpath_07_shortened_name_ok

Same here. If anyone found a way, pls email me: [email protected]
You see, I'm actually a student and I need to finish the code but I cannot open it. The competition is in one week time, so pls help me... Thanks!

@cmaglie
Copy link
Member

cmaglie commented Oct 30, 2019

@Lizews2006 thanks for the bug report but this issue should be solved with IDE 1.8.10, if not please open another issue and do not comment on already closed issues.

Anyway, if you're in a hurry, you may consider renaming the .ino file and the containing folder to a shorter name for a quick workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editor-refactor Related to the refactoring of the Arduino IDE's editor component
Projects
None yet
Development

No branches or pull requests

5 participants