Skip to content

Make hashes path agnostic for GCC - #208

Merged
luser merged 1 commit into
mozilla:masterfrom
mbitsnbites:feature/make_hashes_path_agnostic_for_gcc
Dec 6, 2017
Merged

luser merged 1 commit into
mozilla:masterfrom
mbitsnbites:feature/make_hashes_path_agnostic_for_gcc

Conversation

@mbitsnbites

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

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

@luser

luser commented Dec 6, 2017

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor Author

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

@luser

luser commented Dec 6, 2017

Copy link
Copy Markdown
Contributor

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