-
Notifications
You must be signed in to change notification settings - Fork 39
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
front: skip non-existent paths in gcc depfiles #803
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for opening a PR.
As per the other PR the template needs to be updated. Some of the key questions as part of the template would surface some deeper insights and help produce a deeper fix.
compiler/front/depfiles.nim
Outdated
@@ -25,13 +25,14 @@ proc writeDepsFile*(g: ModuleGraph) = | |||
f.writeLine(toFullPath(g.config, k)) | |||
f.close() | |||
|
|||
func makefileQuoted(path: string): string = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't there already a pre-existing procedure for this like quote shell?
func makefileQuoted(path: string): string = | |
func quoteFilepath(path: string): string = |
Also, this seems like a better name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't there already a pre-existing procedure for this like quote shell?
Yes, but only subset of that is needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, this seems like a better name
Committed.
if path.len == 0: | ||
depfile.write(target.makefileQuoted & ": \\" & '\n') | ||
for path in paths: | ||
if path.len == 0 or not fileExists(path): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't recall when this is called, but if this is meant to produce a reusable description then this shouldn't be filtered here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated PR message
Closing until I remember what package caused this behavior |
Summary
There could be non-existent files in
conf.m.fileInfos
that prevented GCC-style depfiles from behaving correctly. This commit filters them out.Details
Also create a helper function to quote paths for Unix Makefiles.