GCC Python Plugins

Summary

I have created GCC plugins that embed Python 2 and Python 3 within GCC. Interested developers should be able to use this to easily extend GCC by writing Python scripts, such as adding new warnings for a library that they work on, without needing to use C.

Benefit to Fedora

Fedora is already a very attractive platform for software development. By making it very easy to extend GCC, the plugin makes Fedora even more compelling to developers. The plugin code was written by a Fedora developer, and is a "Fedora Hosted" project.

Scope

This involves:

writing the plugin

packaging it

documenting it

keeping it in sync with gcc

How To Test

User Experience

Non-technical end-users of Fedora should see no difference.

Developers will be able to invoke Python scripts whilst running GCC by adding these arguments to GCC's command line:

gcc -fplugin=python2 -fplugin-arg-python2-script=PATH_TO_SCRIPT.py

for a Python 2 script and:

gcc -fplugin=python3 -fplugin-arg-python3-script=PATH_TO_SCRIPT.py

for a Python 3 script.

Dependencies

This will require working closely with the gcc maintainer. I anticipate needing to rebuild the plugin each time that gcc is rebuilt.

Contingency Plan

Documentation

Release Notes

GCC plugins that embed Python are now available. These were written by Fedora contributor David Malcolm and