Skip to content

Enhance the difference reduction between preprocessors

Summary

At previous MR we already applied some difference reduction between Cpp/Haskell/JavaScript preprocessor calls but it was not so aggressive as it potentially could be.

We ended with the implementation where a single function is used to determine how to call preprocessors based on its target language.

2 deeper steps (at least) are possible to improve it a bit more:

  1. Use the same filtering for all preprocessors (cc_filter vs id). Very probably we should use cc_filter everywhere.
  2. Use the same call for all preprocessors (runSomethingResponseFile vs runSomethingFiltered). Again, very probably we should use runSomethingResponseFile everywhere because all known preprocessors support arguments pass in response-file-style (aka @) which allows to read very long command line options at shells where it is limited (Windows Shell, not a Powershell).

Unfortunately at the origin point of changing related code we were unable to test all possible cases to make sure that proposed changes for preprocessors are actually valid. Also we have not enough automatic tests for now to verify it practically well.

Expected behavior

runSourceCodePreprocessor uses single style of call for all preprocessors or we know actual reasons why to not do it.

Environment

  • GHC version used: commit e1cf8dc2c941d36dc92139faa07ee6baf2599e38
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information