pluggable-output-processor icon indicating copy to clipboard operation
pluggable-output-processor copied to clipboard

alternative usage: fall back to import gcc as default module (catch RuntimeError when loading module)

Open GitMensch opened this issue 2 years ago • 0 comments

Currently you need both:

  • something in PATH named as outproc's symlink
  • a module named as outproc's symlink

If the second doesn't exist, there is an error like this:

 * Error: Failed to import module gcp due RuntimeError exception: Failed to import module gcc-7
 *   outproc/cli.py:181: at run
 *     self._load_pp_module()
 *   outproc/cli.py:107: at _load_pp_module
 *     raise RuntimeError('Failed to import module {}'.format(self.basename))

I suggest changing this by explicitly catching the RuntimeError and loading the gcc module instead when this happens. This allows the previous usage while still removing the need to symlink the gcc configuration to a bunch of different names if you use multiple gcc versions.

Additionally, this allows to reduce the distribution by removing cc.py, c++.py and g++.py (and removes the current need to add the otherwise "missing" ld.py) from outproc/pp.

GitMensch avatar Oct 09 '23 09:10 GitMensch