From Fedora Project Wiki
(Cross-Distribution Collaboration)
(Document approach)
Line 2: Line 2:


This page collects some technical details related to [[Changes/PortingToModernC]].
This page collects some technical details related to [[Changes/PortingToModernC]].
== Overall Approach ==
We build packages with instrumented `gcc` and `redhat-rpm-config` packages that fail the build if certain errors occur anywhere during the build. These forced failures are guaranteed to happen even if the build system ignores the exit status of a `gcc` command and continues regardless (for example, during `configure` checks). This is implemented by patching `gcc` in a special buildroot to log certain errors to a 1777 (sticky bit permission) directory. After the build, `redhat-rpm-config` checks if the directory is empty (or more precisely, only contains expected errors), and fails the build otherwise.
* [https://src.fedoraproject.org/fork/fweimer/rpms/gcc/tree/c99-port rawhide gcc fork with instrumentation]
* [https://src.fedoraproject.org/fork/fweimer/rpms/redhat-rpm-config/tree/c99-port rawhide redhat-rpm-config fork with instrumentation]


== Cross-Distribution Collaboration ==
== Cross-Distribution Collaboration ==

Revision as of 14:56, 2 November 2022

Porting Fedora to Modern C

This page collects some technical details related to Changes/PortingToModernC.

Overall Approach

We build packages with instrumented gcc and redhat-rpm-config packages that fail the build if certain errors occur anywhere during the build. These forced failures are guaranteed to happen even if the build system ignores the exit status of a gcc command and continues regardless (for example, during configure checks). This is implemented by patching gcc in a special buildroot to log certain errors to a 1777 (sticky bit permission) directory. After the build, redhat-rpm-config checks if the directory is empty (or more precisely, only contains expected errors), and fails the build otherwise.

Cross-Distribution Collaboration

A mailing list has been set up to exchange issues and observations of wider interest: c-std-porting@lists.linux.dev (archive)

Further resources will follow as needed.

Fedora Bug Tracking

Not every build issue will have a bug in Bugzilla. But if there is no upstream with a mailing list or issue tracker to submit fixes to, it makes sense to create a bug in Bugzilla, especially for cross-distribution collaboration.

Currently, these trackers exist:

  • PortingToModernC Umbrella tracker for the tracker bugs below.
  • PortingToModernCExemptions Bugs which document that certain packages could not be switched to C99 or later language standards. Typically these packages keep building with -std=gnu89.
  • PortingToModernCHelpNeeded Bugs where help from the package maintainer is needed to address the issue(s).