Skip to content

Make hashes path agnostic for GCC#208

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

Make hashes path agnostic for GCC#208
luser merged 1 commit intomozilla:masterfrom
mbitsnbites:feature/make_hashes_path_agnostic_for_gcc

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. :)

@luser luser mentioned this pull request Sep 4, 2018
2 tasks
tottoto pushed a commit to tottoto/sccache that referenced this pull request Feb 6, 2026
BREAKING CHANGE: Add new `Decoder/Encoder` traits and use `EncodeBuf/DecodeBuf` over `BytesMut` directly.
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