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

preprocessor cache/direct mode doesn't produce -MF output #2194

Open
glandium opened this issue May 29, 2024 · 2 comments
Open

preprocessor cache/direct mode doesn't produce -MF output #2194

glandium opened this issue May 29, 2024 · 2 comments

Comments

@glandium
Copy link
Collaborator

STR:

touch foo.h
echo '#include "foo.h"' > foo.c
sccache gcc -o foo.o -c foo.c -MD -MF foo.pp

On the first run, sccache calls the preprocessor, which produces the foo.pp file, with contents:

foo.o: foo.c /usr/include/stdc-predef.h foo.h

Typically, this would be used by a build system to know when to rebuild foo.o. Without this file, the build system wouldn't know to rebuild foo.o when e.g. foo.h changes.

Now, clean your build directory and try again:

rm foo.o foo.pp
sccache gcc -o foo.o -c foo.c -MD -MF foo.pp

Now here's the problem: since the preprocessor wasn't called, and since the preprocessor cache doesn't store what would normally be in foo.pp, foo.pp is not created.

@glandium
Copy link
Collaborator Author

preprocessor cache doesn't store what would normally be in foo.pp

well, technically, it kind of does, in a different form, and it doesn't know how to recreate foo.pp from that.

@glandium
Copy link
Collaborator Author

#2195 addresses this in the same way #2173 addressed #2122: by disabling preprocessor cache when it's broken.

This issue and #2122 will likely need common changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant