-
-
Notifications
You must be signed in to change notification settings - Fork 114
Dependency file parsing assumes one file per line #136
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
Comments
Ok, thanks Matthijs. |
Time passes by........... and nothing happens.........? |
This worked properly when I implemented in Java. But to be fair, I didn't handle spaces in pathnames properly until much later. So many little details to get right... |
Hi Paul, Is that something I can do? |
IMHO the difference between the original java version and this one is in the loop here: for _, row := range rows {
depStat, err := os.Stat(row)
if err != nil && !os.IsNotExist(err) {
return false, i18n.WrapError(err)
}
if os.IsNotExist(err) {
return false, nil
}
if depStat.ModTime().After(objectFileStat.ModTime()) {
return false, nil
}
} IIRC the java version returned The long term solution is to properly parse the .d file, that may have more than one file per line, this could be tricky because the file are separated by space |
The missing file is probably due to a parsing error, better to trigger a rebuild in this case instead of exiting with an error. This is a quick workaround, the full solution is to properly parse .d files. Fix arduino#136 Signed-off-by: Cristian Maglie <[email protected]>
Well, to be precise, there is already the condition
so in some way the parsed filename |
Wouldn't it be better to keep this issue open until it is really properly fixed? Also, I think that a proper fix might share some code with a fix for this comment: #131 (comment) |
Hi mathhijs, The supplied arduino-builder.exe cures the problem, but as suspected, rebuilds all each time. Are you talking about a fix that doesn't rebuild if there is a problem? That would be better. |
yes, github auto-closed the issue becuase of my comment on the PR. |
Hello guys, we got a new problem.....
Thanks, Graham |
Hi @ghlawrence2000 , |
Apparently, the parsing of .d files assumes there is a single file on each line of the file. However, in some cases, presumably when filenames are short, there might be more than one in a single line. Consider this example from this report.
The relevant source is here: https://github.com/arduino/arduino-builder/blob/master/src/arduino.cc/builder/builder_utils/utils.go#L222-L233
I guess the solution here is to do more proper parsing of the file, such as removing any escaped newlines, and then splitting the result into filenames (taking into account escaped spaces). I'm not entirely sure how reliable this can be done, since GNU make is known to be bad in handling spaces in filenames (though I think it works ok as long as no variables are involved).
The text was updated successfully, but these errors were encountered: