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

Make hashes path agnostic for GCC #208

Merged

Conversation

mbitsnbites
Copy link
Contributor

We now pass -P to the preprocessor, which inhibits the generation
of linemarkers. This has two positive side effects:

  1. Absolute file paths and file names are excluded from the
    preprocessor output, which makes the hash independent of
    the location of the source and build directories.

  2. The preprocessing step is slightly faster (in one case it
    was 20% faster) and the preprocessor output is smaller (in
    the aforementioned case the output was 23% smaller) which
    should translate into faster hashing too.

We now pass -P to the preprocessor, which inhibits the generation
of linemarkers. This has two positive side effects:

  1. Absolute file paths and file names are excluded from the
     preprocessor output, which makes the hash independent of
     the location of the source and build directories.

  2. The preprocessing step is slightly faster (in one case it
     was 20% faster) and the preprocessor output is smaller (in
     the aforementioned case the output was 23% smaller) which
     should translate into faster hashing too.
@mbitsnbites
Copy link
Contributor Author

According to my testing, this PR fixes #207 for GCC (and hopefully Clang too).

@luser
Copy link
Contributor

luser commented Dec 6, 2017

Great find! Since we no longer compile from the preprocessor output this shouldn't harm anything and it fixes this longstanding issue in a simple way. I think there still might be some quirks about file paths in debug info, but we can sort that out later.

It turns out MSVC does have an equivalent option: -EP (vs. just -E). I'll switch the MSVC code to use that in a followup.

@luser luser merged commit 98d2b30 into mozilla:master Dec 6, 2017
@mbitsnbites
Copy link
Contributor Author

Sweet! This makes sccache much more attractive for our slightly heterogeneous machine park.

@luser
Copy link
Contributor

luser commented Dec 6, 2017

We punted and just do all our CI builds in the same Docker image in the same paths. :)

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 this pull request may close these issues.

2 participants