eried / Arduino

open-source electronics prototyping platform - enhanced release for Windows
http://arduino.cc/forum/index.php/topic,118440.0.html
Other
10 stars 2 forks source link

white spaces in path prevent Compilation speed-up #2

Open mpflaga opened 11 years ago

mpflaga commented 11 years ago

Very, very helpful.

Where as I find a not so obvious issue with recompiling. At least on Windows XP and 7, likely others Windows. (and likely not on Linux). The "is_already_compiled" enhancement (from Paul Stoffregen) does not appear to work when ERW is installed into the recommended default directories. Through experimenting I have determined that it is due the white spaces in the pathname. Such as "C:\Program Files (x86)\Arduino\Arduino ERW 1.0.4" for Win7 and "C:\Program Files\Arduino\Arduino ERW 1.0.4" for WinXP. It is best seen with the IDE's preferences enabling verbose output for compilation.

Simply moving and renaming to "C:\Projects\Arduino\Arduino_ERW_1.0.4" then allows recompile's to take advantage of the "is_already_compiled" feature, for subsequent compiles. Speeding them up. Note the underscores (replacing the white space and yet the periods are still there.

Simply running the arduino.exe from a short cut, using 8.3 brief names (such as "C:\PROGRA~2\Arduino\ARDUIN~1.4" does not work. Neither does it work executing "C:\PROGRA~2\Arduino\ARDUIN~1.4\arduino.exe" from the RUN prompt. Where it does work correctly from a CMD prompt. Note the issue likely is not with the path of the temp file, but that of arduino.exe.

Note being an expert, but I believe the symptoms indicate the issue is related as to how java is treating the paths with its modified tests.

As a result in that the ERW installs using such a pathname, this subtle but very helpful prior feature is disabled.

eried commented 11 years ago

Can you provide more details about that feature? I tried to solve (and remove the 8.3 stuff where I was able to because it is something provided for Win9X support and it was even causing problems on similar projects like https://github.com/energia/Energia) but if you provide more details about how to test it maybe I can find the root problem and/or make it default in this mod

mpflaga commented 11 years ago

My test was simple, in that I had used your installer which placed it into the "C:\Program Files (x86)\Arduino\Arduino ERW 1.0.4" . I then simply copied it to C:\Projects\Arduino\Arduino_ERW_1.0.4, noting the changing of white spaces to underscores. I then simply ran arduino.exe from each. And then compiled. The first time as expected would be a clean compile, for each. Then recompiled. The later was not a clean and the prior was, thus long and dragged out.

I am no expert on the subject, but I believe the .\Arduino\app\src\processing\app\debug\Compiler.java method is_already_compiled (added by Paul Stoffregen) is likely returning incorrectly (at least on windows) not handling white space in the path or file names. I might suspect the "if (!obj.exists()) return false;" source security.checkRead(path); throws an exception on the white space. I am to proficient enough yet to run it in an IDE and set a break point to prove the theory. Nor determine how to resolve it.

eried commented 11 years ago

I see, I thought you were talking about the 'add-in' Paul developed for his teensy. It seems I get the speedy compilation even having the default path for the Arduino IDE: http://cl.ly/PC9j mainly because my user dir has no spaces?

mpflaga commented 11 years ago

Note that the problem is not necessarily the temp space but in where the installer puts the ERW into the “program files”. I think you get that. But your below picture is only showing the paths for the temp space. Not the environment space.

About the plug in. I am not sure how Paul’s stuff works, wholly. But I noticed his installer does not identify the ERW as the Arduino environment and won’t update it. Or if what your mean “the plug in” add the material needed. I have been diff’ing the ERW and an original Arduino updated with teensy and merging the diffs to get a single directory.

While I am at it.

Not sure why Arduino stays with 4.3.2. It appears that there are some Linux boxes that are using newer separate avr-gcc’s and I have gotten complaints on my library and SdFat with newer avr-gcc. So I have also updated avr-gcc to 4.8.0, found on source forge. I recall that when using 4.7.0 and with older 1.0.X, I had to update a few libraries. But I don’t recall needing to do so with 1.0.4 and 4.8.0, as I think they have correct the bad practices, caught by the newer compiler.

Michael P. Flaga, michael@flaga.net

From: Erwin Ried [mailto:notifications@github.com] Sent: Friday, May 24, 2013 7:10 PM To: eried/Arduino Cc: Michael P. Flaga Subject: Re: [Arduino] white spaces in path prevent Compilation speed-up (#2)

I see, I thought you were talking about the 'add-in' Paul developed for his teensy. It seems I get the speedy compilation even having the default path for the Arduino IDE: http://cl.ly/PC9j mainly because my user dir has no spaces?

— Reply to this email directly or view it on GitHub https://github.com/eried/Arduino/issues/2#issuecomment-18434877 . https://github.com/notifications/beacon/FypaQOgCHwt2bsBNB7c8let_gCNAGS45J9qHkUVX4eVx8rJcBJGZUvsmqlgLZlyJ.gif

eried commented 11 years ago

OK, I was just looking how to replicate the issue here to try to fix it, but I am not able to notice any difference if I run the official one from a path without spaces in terms of speed.

mpflaga commented 11 years ago

Sorry about the delay in getting back. Been very busy.

I have attached a zip file of the logs of 3 compiles (1st and 2 subsequent) for two conditions where the installed path is :

"C:\Program Files (x86)\Arduino\Arduino ERW 1.0.5\arduino.exe" note the spaces.

"C:\projects\Arduino\Arduino_ERW_1.0.5\arduino.exe" note the underscores.

Note I simply copied the "C:\Program Files (x86)\Arduino\Arduino ERW 1.0.5\" to "C:\projects\Arduino\Arduino_ERW_1.0.5\" To make subsequent compiles faster.

From the logs we can see that the two subsequent from the executable that has no whitespace did not re-compile the O files, that already existed. Where the logs from the executable with white space did recompile each and every one of the O files, unnecessarily.

It may be possible you were not able to see the difference if the INO was small enough to make much of a time difference. The compile logs attached are of a larger project that take several minutes to compile on my machine. My machine also has enterprise spyware that reports the execution of each program, so a compile of a clean make takes much longer.

Michael P. Flaga, michael@flaga.net

From: Erwin Ried [mailto:notifications@github.com] Sent: Tuesday, May 28, 2013 11:47 AM To: eried/Arduino Cc: Michael P. Flaga Subject: Re: [Arduino] white spaces in path prevent Compilation speed-up (#2)

OK, I was just looking how to replicate the issue here to try to fix it, but I am not able to notice any difference if I run the official one from a path without spaces in terms of speed.

— Reply to this email directly or view it on GitHub https://github.com/eried/Arduino/issues/2#issuecomment-18559475 .Image removed by sender.