brintos

brintos / llvm-project-archived public Read only

0
0
Text · 11.2 KiB · 0766522 Raw
243 lines · plain
1=============================2LLVM Community Support Policy3=============================4 5As a compilation infrastructure, LLVM has multiple types of users, both6downstream and upstream, of many combinations of its projects, tools and7libraries.8 9There is a core part of it that encompass the implementation of the compiler10(front/middle/back ends), run-time libraries (RT, C++, OpenMP, etc) and11associated tools (debugger, linker, object file manipulation, etc). These12components are present in the public release on our supported architectures13and operating systems and the whole community must maintain and care about.14 15There are, however, other components within the main repository that either16cater to a specific sub-community of LLVM (upstream or downstream) or17help parts of the community to integrate LLVM into their own development tools18or external projects. Those parts of the main repository don't always have19rigorous testing like the core parts, nor are they validated and shipped with20our public upstream releases.21 22Even not being a core part of the project, we have enough sub-communities23needing those changes with enough overlap that having them in the main24repository is beneficial to minimise the repetition of those changes in all25the external repositories that need them.26 27But the maintenance costs of such diverse ecosystem is non trivial, so we divide28the level of support in two tiers: core and peripheral, with two29different levels of impact and responsibilities. Those tiers refer only to the30main repository (``llvm-project``) and not the other repositories in our git31project, unless explicitly stated.32 33Regardless of the tier, all code must follow the existing policies on quality,34reviews, style, etc.35 36Core Tier37=========38 39The core tier encompasses all of the code in the main repository that is40in production, is actively tested and released in a regular schedule, including41core LLVM APIs and infrastructure, front/middle/back-ends, run-time libraries,42tools, etc.43 44It is the responsibility of **every** LLVM developer to care for the core tier45regardless of where their work is applied to.46 47What is covered48---------------49 50The core tier is composed of:51 * Core code (``llvm-project``) present in official releases and buildbots:52   compiler, debugger, linker, libraries, etc, including infrastructure code53   (table-gen, lit, file-check, unit-tests, etc).54 * Build infrastructure that creates releases and buildbots (CMake, scripts).55 * `Phabricator <https://github.com/llvm/phabricator>`_ and56   `buildbot <https://github.com/llvm/llvm-zorg>`_ infrastructure.57 * The `test-suite <https://github.com/llvm/llvm-test-suite>`_.58 59Requirements60------------61 62Code in this tier must:63 * Keep official buildbots green, with warnings on breakages being emailed to64   all affected developers. Those must be fixed as soon as possible or patches65   must be reverted, as per review policy.66 * Bit-rot of a component in the core tier will result in that component being67   downgraded to the peripheral tier or being removed. Sub-communities can68   avoid this by fixing all raised issues in a timely manner.69 70Peripheral Tier71===============72 73The peripheral tier encompass the parts of LLVM that cater to a specific74sub-community and which don't usually affect the core components directly.75 76This includes experimental back-ends, disabled-by-default options and77alternative paths (work-in-progress replacements) in the same repository, as78well as separate efforts to integrate LLVM development with local practices.79 80It is the responsibility of each sub-community to care about their own parts81and the intersection of that with the core tier and other peripheral parts.82 83There are three main groups of code that fit in this category:84 * Code that is making its way into LLVM, via the `experimental <https://llvm.org/docs/DeveloperPolicy.html#introducing-new-components-into-llvm>`_85   roadmap or similar efforts.86 * Code that is making its way out of LLVM, via deprecation, replacement or87   bit-rot, and will be removed if the sub-community that cares about it88   cannot maintain it.89 * Code that isn't meant to be in LLVM core and can coexist with the code in90   the core tier (and others in the peripheral tier) long term, without causing91   breakages or disturbances.92 93What is covered94---------------95 96The peripheral tier is composed of:97 * Experimental targets and options that haven't been enable by default yet.98 * Main repository projects that don't get released or regularly tested.99 * Legacy tools and scripts that aren't used in upstream validation.100 * Alternative build systems (ex. GN, Bazel) and related infrastructure.101 * Tools support (ex. gdb scripts, editor configuration, helper scripts).102 103Requirements104------------105 106Code in this tier must:107 * Have a clear benefit for residing in the main repository, catering to an108   active sub-community (upstream or downstream).109 * Be actively maintained by such sub-community and have its problems addressed110   in a timely manner.111 112Code in this tier must **not**:113 * Break or invalidate core tier code or infrastructure. If that happens114   accidentally, reverting functionality and working on the issues offline115   is the only acceptable course of action.116 * Negatively affect development of core tier code, with the sub-community117   involved responsible for making changes to address specific concerns.118 * Negatively affect other peripheral tier code, with the sub-communities119   involved tasked to resolve the issues, still making sure the solution doesn't120   break or invalidate the core tier.121 * Impose sub-optimal implementation strategies on core tier components as a122   result of idiosyncrasies in the peripheral component.123 * Have build infrastructure that spams all developers about their breakages.124 * Fall into disrepair. This is a reflection of lack of an active sub-community125   and will result in removal.126 127Code in this tier should:128 * Have infrastructure to test, whenever meaningful, with either no warnings or129   notification contained within the sub-community.130 * Have support and testing that scales with the complexity and resilience of131   the component, with the bar for simple and gracefully-degrading components132   (such as editor bindings) much lower than for complex components that must133   remain fresh with HEAD (such as experimental back-ends or alternative build134   systems).135 * Have a document making clear the status of implementation, level of support136   available, who the sub-community is and, if applicable, roadmap for inclusion137   into the core tier.138 * Be restricted to a specific directory or have a consistent pattern (ex.139   unique file suffix), making it easy to remove when necessary.140 141Inclusion Policy142================143 144To add a new peripheral component, send an RFC to the appropriate dev list145proposing its addition and explaining how it will meet the support requirements146listed above. Different types of components could require different levels of147detail. when in doubt, ask the community what's the best approach.148 149Inclusion must reach consensus in the RFC by the community and the approval of150the corresponding review (by multiple members of the community) is the official151note of acceptance.152 153After merge, there often is a period of transition, where teething issues on154existing buildbots are discovered and fixed. If those cannot be fixed straight155away, the sub-community is responsible for tracking and reverting all the156pertinent patches and retrying the inclusion review.157 158Once the component is stable in tree, it must follow this policy and the159deprecation rules below apply.160 161Due to the uncertain nature of inclusion, it's advisable that new components162are not added too close to a release branch. The time will depend on the size163and complexity of the component, so adding release and testing managers on the164RFC and review is strongly advisable.165 166Deprecation Policy167==================168 169The LLVM code base has a number of files that aren't being actively maintained.170But not all of those files are obstructing the development of the project and171so it remains in the repository with the assumption that it could still be172useful for downstream users.173 174For code to remain in the repository, its presence must not impose an undue175burden on maintaining other components (core or peripheral).176 177Warnings178--------179 180There are multiple types of issues that might trigger a request for deprecation,181including (but not limited to):182 183 * Changes in a component consistently break other areas of the project.184 * Components go broken for long periods of time (weeks or more).185 * Clearly superior alternatives are in use and maintenance is painful.186 * Builds and tests are harder / take longer, increasing the cost of187   maintenance, overtaking the perceived benefits.188 189If the maintenance cost is higher than it is acceptable by the majority of190developers, it means that either the sub-community is too small (and the extra191cost should be paid locally), or not active enough (and the problems won't be192fixed any time soon). In either case, removal of such problematic component is193justified.194 195Steps for removal196-----------------197 198However clear the needs for removal are, we should take an incremental approach199to deprecating code, especially when there's still a sub-community that cares200about it. In that sense, code will never be removed outright without a series201of steps are taken.202 203A minimum set of steps should be:204 #. A proposal for removal / deactivation should be made to the Discourse forums 205    (under the appropriate category), with a clear206    statement of the maintenance costs imposed and the alternatives, if207    applicable.208 #. There must be enough consensus on the list that removal is warranted, and no209    pending proposals to fix the situation from a sub-community.210 #. An announcement for removal must be made on the same lists, with ample time211    for downstream users to take action on their local infrastructure. The time212    will depend on what is being removed.213 214    #. If a script or documents are to be removed, they can always be pulled215       from previous revision, and can be removed within days.216    #. if a whole target is removed, we need to first announce publicly, and217       potentially mark as deprecated in one release, only to remove on the218       next release.219    #. Everything else will fall in between those two extremes.220 #. The removal is made by either the proposer or the sub-community that used to221    maintain it, with replacements and arrangements made atomically on the same222    commit.223 224If a proposal for removal is delayed by the promise a sub-community will take225care of the code affected, the sub-community will have a time to fix all the226issues (depending on each case, as above), and if those are not fixed in time, a227subsequent request for removal should be made and the community may elect to228eject the component without further attempts to fix.229 230Reinstatement231-------------232 233If a component is removed from LLVM, it may, at a later date, request inclusion234of a modified version, with evidence that all of the issues were fixed and that235there is a clear sub-community that will maintain it.236 237By consequence, the pressure on such sub-community will be higher to keep238overall maintenance costs to a minimum and will need to show steps to mitigate239all of the issues that were listed as reasons for its original removal.240 241Failing on those again, will lead to become a candidate for removal yet again.242 243