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

Support rewrite_includes_only with clang-cl #894

Closed
mstange opened this issue Dec 3, 2020 · 0 comments · Fixed by #896
Closed

Support rewrite_includes_only with clang-cl #894

mstange opened this issue Dec 3, 2020 · 0 comments · Fixed by #896

Comments

@mstange
Copy link
Contributor

mstange commented Dec 3, 2020

To avoid large swathes of compiler warnings during distributed compilation, we try to limit client-side preprocessing to only resolve includes, and not substitute #defines etc. This mode is enabled when rewrite_includes_only = true is set in the dist config.

However, this mode is currently unimplemented on Windows: msvc.rs ignores the rewrite_includes_only parameter.

_rewrite_includes_only: bool,

MSVC's cl.exe does not appear to support an argument to unlock this mode. However, clang-cl does, in an underhanded way, with the -clang:-frewrite-includes argument. So we can support rewrite_includes_only in msvc.rs if clang-cl is used.

With this change, I've been able to build Firefox on Windows with distributed sccache successfully. Without this change, the build was 1. failing because some directories had -Werror enabled and 2. extremely slow, because the console delayed everything by trying to keep up with the huge amounts of warning output.

mstange added a commit to mstange/sccache that referenced this issue Dec 3, 2020
glandium pushed a commit that referenced this issue Dec 11, 2020
Xanewok referenced this issue in paritytech/cachepot Apr 2, 2021
drahnr referenced this issue in paritytech/cachepot Apr 6, 2021
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

Successfully merging a pull request may close this issue.

1 participant