Enge Zusammenarbeit mit Upstream-Projekten
Das Fedora-Projekt legt größten Wert darauf, sich bei der in den Paketquellen enthaltenen Software so weit wie möglich an den Originalquellcode zu halten. Die folgenden Richtlinien enthalten allgemeine bewährte Vorgehensweisen und erläutern, warum dies sinnvoll ist, geben Tipps zum Einreichen von Patches und zeigen mögliche Ausnahmen auf, die Fedora zulassen könnte. Hauptziel ist es, die Vorteile einer gemeinsamen Codebasis für Endnutzer und Entwickler zu nutzen und gleichzeitig unnötigen Wartungsaufwand zu reduzieren.
- upstream (Substantiv)
-
Bei Projekten im Bereich freier und quelloffener Software bezeichnet der Begriff Upstream das Projekt, das ein Programm oder eine Sammlung von Programmen entwickelt. Fedora ist im Verhältnis zu diesen Projekten Downstream angesiedelt. Der Begriff leitet sich von der Vorstellung ab, dass Wasser – und die darin mitgeführten Güter – flussabwärts strömen und denjenigen zugutekommen, die sie dort in Empfang nehmen.
- to upstream (Verb)
-
Eine Kurzform für „Änderungen zum Upstream-Projekt hochladen“.
Was sind Abweichungen vom Upstream-Projekt?
-
Patches: Patches sind die häufigste und offensichtlichste Art von Änderungen gegenüber dem Upstream-Projekt. Patches können vom Paketbetreuer geschrieben, aus dem Upstream-Projekt übernommen oder zurückportiert oder aus anderen Distributionen übernommen werden.
-
Ausführen von sed oder Ähnlichem auf einer Spec-Datei: Auch wenn diese Änderung weniger offensichtlich ist, sollte sie im Rahmen dieses Leitfadens als funktional gleichwertig mit einem Patch betrachtet werden. Ein Patch ist zudem vorzuziehen, da die Verwendung von sed die Software bisweilen auf unbeabsichtigte Weise verändern kann – insbesondere wenn der Paketbetreuer eine neue Upstream-Veröffentlichung als Aktualisierung bereitstellt. Solche Änderungen sind im Vergleich zu einem fehlgeschlagenen Patch unter Umständen nicht sofort ersichtlich.
-
Desktop-Dateien, systemd-Unit-Dateien usw. werden manchmal als zusätzliche Quellen hinzugefügt: Wenn Sie dies als Paketbetreuer tun, müssen Sie die Upstream-Entwickler benachrichtigen und idealerweise erreichen, dass diese in den Upstream-Quellcode aufgenommen werden. Die separate Pflege erfordert oft zusätzlichen Aufwand.
-
Konfigurationsoptionen: Wenn beispielsweise eine bestimmte Upstream-Software sowohl MySQL als auch Postgres als Datenbank-Backend unterstützt, haben sich andere Distributionen möglicherweise für Postgres entschieden, während das Fedora-Paket standardmäßig für die Verwendung des MySQL-Backends konfiguriert sein könnte. Wenn Upstream-Projekte oder andere Distributionen eine der Optionen bevorzugen, sollten Sie das Gespräch mit ihnen suchen, die Gründe dafür in Erfahrung bringen und sich nach Möglichkeit auf bewährte und konsistente Optionen stützen.
-
Zugrundeliegende Bibliotheken und andere Softwarekomponenten: Selbst ohne gezielte Änderungen kann sich Software in Fedora von der Upstream-Version oder von anderen Distributionen unterscheiden, bedingt durch spezifische Bibliotheksversionen oder andere Softwarekomponenten, von denen Ihr Paket abhängt. So könnte Firefox beispielsweise einen Fehler in SQLite offenlegen, und Fedora ist womöglich die einzige Distribution, die genau diese Firefox-Version gegen diese spezifische SQLite-Version kompiliert. Sie sollten sich mit dem Upstream-Projekt austauschen, um zu erfahren, ob derartige Probleme bekannt sind, und die Bug-Tracker des Upstream-Projekts oder anderer verbreiteter Distributionen durchsuchen, um solche Probleme ausfindig zu machen.
-
Sonstiges: Die obige Liste ist nicht vollständig. Selbst scheinbar geringfügige Änderungen, wie etwa das spezifische Desktop-Theme oder die Schriftarten, können Fehler in anderer Software verursachen oder einen Fehler im Theme bzw. in der Schriftart offenlegen – allerdings nur in Verbindung mit bestimmter Software. So könnte LibreOffice beispielsweise Probleme bei der Darstellung einer Liste haben, wenn das Adwaita-Theme und die Schriftart DejaVu verwendet werden. Berücksichtigen Sie bei der Fehleranalyse stets die Auswirkungen jeder Änderung, sei es durch Fedora oder durch die Benutzer selbst.
Warum sollen Änderungen an das Upstream-Projekt zurückgeführt werden?
-
Common Benefit And Reduced Maintenance Burden: When Fedora carries patches that are specific to Fedora or deviations from upstream projects, those patches are not shared by every distribution. This puts the burden of maintaining those patches on Fedora, which includes keeping those patches in a functional state by rewriting or forward-porting them for every upstream release. This effort can quickly add up to be overwhelming, while not being in the spirit of sharing the benefits (as well as the effort in maintaining) free and open source software.
-
Documentation: Upstream projects are documented formally (in the form of man/info pages and longer guides) and informally in many user forums or mailing lists as answers to user questions. Deviations from upstream projects can thus confuse end users and upstream developers when those patches cause changes in behavior that are Fedora specific and not documented properly, even where the formal documentation (such as man pages) are also patched to describe the changes.
-
Translations: Maintaining translations upstream gains the advantage of established translation communities, which are most likely more experienced with the project terms. Downstream projects benefit when using those translations. In addition, it lifts the burden of hosting, and of the need to merge often from upstream to downstream and back again. To make sure translation work continues upstream. Any string changes that were introduced by patches should be maintained by the downstream community.
-
Upstream Acceptance: Fedora is downstream of many thousands of software projects. Much of this software is packaged by maintainers who are not programmers or lack expertise in the language(s) the software is written in. In some cases the software has a large and complex codebase (such as the kernel or Libreoffice) and the package maintainers might not have the same level of understanding in all areas compared to subsystem maintainers or upstream developers. For this and other reasons, Fedora needs the acceptance of upstream software developers. These developers may view any significant patches as a fork or refuse to take bug reports from Fedora users due to the differences in the codebase. Fedora as a project strives to be welcoming and cooperative with upstream developers as much as possible. We must avoid Fedora specific patches and any patches that are useful should be sent upstream to these developers via mailing lists, bug trackers, or direct email.
-
Quality Assurance: Patches that are accepted upstream are usually reviewed or tested by many people including developers and testers. This includes testing by other GNU/Linux distributions. A deviation from the common codebase used by many is a potential chance of introducing a regression that is specific to Fedora.
-
Security: A special case of the "Quality Assurance" issue is that changes that have surprising security implications are more likely to be detected by upstream (who often have deeper knowledge of the program).
-
Fast incremental improvements: Staying close to upstream versions is helpful when doing version bumps for updates that bring in new features. This prevents tedious backporting of only security and bug fixes. Deviations from upstream can significantly hamper the speed of delivering improvements from new versions to end users. However, regressions are to be avoided, and potential improvements and new features must be carefully assessed against the risk of harming the users experience. Refer to Updates Policy for more details.
-
ABI or API Deviations: Patches that introduce a new application binary interface (ABI) or application program interface (API) must be especially avoided, even if the ABI/API changes are planned to land upstream. When these patches get upstream (if ever), upstream developers might introduce changes in the ABI/API during the code review process before merging the code. This could break other software in the repository that makes use of the Fedora-patched ABI/API.
-
Direct End User Feedback: When users run into problems with any software that is in Fedora, they can report the problems directly upstream. By not deviating from upstream, it remains a central location for all bug reports on that software, leaving Fedora package maintainers to concentrate on good packaging instead of acting in between users and upstream issues.
Tips On Upstreaming Patches
-
Talk to upstream. Maintaining a regular flow of communication with the upstream project is helpful in understanding the upstream developers well, and encourages them to be more responsive to your requests. It also helps in understanding technical issues, such as how they prefer patches to be submitted.
-
Make the patches generic enough to be maintained by upstream developers. Explain the need for your patches, that is, what bugs they fix or what features they add. Any references to bugzilla reports or user requests can be quite useful for the developers who receive your patches.
-
Do not consider any change to be too small to be sent upstream. Even minor changes like fixing a permission problem in a file or excluding an empty file can and should be reported upstream even if upstream does not necessarily act on all of them quickly.
-
Divide patches into small and independent chunks that remain functional, so they can be understood, reviewed, and accepted or rejected individually.
-
If the patch introduces new strings or changes existing ones, make the changes as generic as possible.
-
Fix your coding style to match the upstream project’s guidelines. This might seem trivial but many upstream projects insist on following their guidelines so that their codebase looks internally self consistent and is more maintainable.
-
Where possible, encourage upstream point-releases that fix bugs and security issues only, to avoid the possibility of regressions.
-
Test your changes as thoroughly as you can before you send them upstream. Broken patches leave a long-lasting bad impression.
-
Be patient and cooperative. If feedback is offered, discuss changes, answer questions, and provide revisions that fix any problems. Don’t flame or argue unnecessarily with upstream developers. The overall goal is persuade upstream developers to get your patches committed upstream and not to demonstrate "who is better." Don’t forget the human element in these conversations. If necessary, we will have to carry some patches downstream to enforce our policies even if upstream does not agree with us at that point.
Some Examples Of Exceptions
-
Severe Security Issues Or Major Bug Fixes: For any major issues such as security holes or data loss problems, waiting on a new release from upstream can be too much of a delay. In these instances, it may be better to backport those fixes from upstream or fix the issue by writing your own patch and do an update in Fedora. If you are writing a new patch, send it upstream so that Fedora shares the benefits and avoid deviations in new releases that follow. Be careful when expeding the patching however. A security patch that is not comprehensive can leave unexpected security holes still open or a patch to fix a major problem can worsen the problem. Get your patches peer reviewed as much as possible. Due to differences in release schedules between upstream projects and Fedora releases, maintainers would have to keep in mind feature and development freezes in Fedora and fix problems accordingly.
-
Non-free or patent encumbered software: If upstream projects include software that is non-free or has known patent issues, such software does not meet the Licensing Guidelines and Fedora will not include them. In many instances, such code is optional in the form of plugins that Fedora simply does not need to include in its software repository. In other cases, it might be possible to work with upstream on making it optional or patch specific portions.
-
Unmaintained Or Unresponsive Upstream Projects: In cases where upstream projects are either unmaintained or unresponsive, it might be acceptable to patch the software. If upstream is unmaintained, you might want to consider sharing patches with other distributions or taking over maintenance if you have the time, skills, and interest. Be wary of maintaining software with no upstream since all the burden of maintaining the codebase as well as packaging issues are with you. If upstream is unresponsive and many distributions are deviating significantly, it might be a opportunity for a cross distribution fork (Similar to XFree86 and Xorg).
-
Patches Heading Upstream: Any patches that are known to be headed upstream might be patched temporarily in Fedora if the patches provide important bug fixes or in rare cases, features to users. If this is done, maintenance effort of the patches should be low impact for the small amount of time until upstream merges the patches and does a new release.
-
Distribution Integration: There are features that are critical or very good to have for Fedora as a distribution but not been significant enough for various upstream projects to accept related enhancements just yet. Use your discretion carefully when choosing to integrate any such patches since there is a trade off between upstream acceptance and Fedora integration and associated costs/benefits.
-
Bundling of Libraries: Refer to the Bundling and Duplication of System Libraries section of the Packaging Guidelines for details. Fixes related to bundling should of course be sent upstream if possible.
Want to help? Learn how to contribute to Fedora Docs ›