xref: /aosp_15_r20/external/angle/third_party/abseil-cpp/CONTRIBUTING.md (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1*8975f5c5SAndroid Build Coastguard Worker# How to Contribute to Abseil
2*8975f5c5SAndroid Build Coastguard Worker
3*8975f5c5SAndroid Build Coastguard WorkerWe'd love to accept your patches and contributions to this project. There are
4*8975f5c5SAndroid Build Coastguard Workerjust a few small guidelines you need to follow.
5*8975f5c5SAndroid Build Coastguard Worker
6*8975f5c5SAndroid Build Coastguard WorkerNOTE: If you are new to GitHub, please start by reading [Pull Request
7*8975f5c5SAndroid Build Coastguard Workerhowto](https://help.github.com/articles/about-pull-requests/)
8*8975f5c5SAndroid Build Coastguard Worker
9*8975f5c5SAndroid Build Coastguard Worker## Contributor License Agreement
10*8975f5c5SAndroid Build Coastguard Worker
11*8975f5c5SAndroid Build Coastguard WorkerContributions to this project must be accompanied by a Contributor License
12*8975f5c5SAndroid Build Coastguard WorkerAgreement. You (or your employer) retain the copyright to your contribution,
13*8975f5c5SAndroid Build Coastguard Workerthis simply gives us permission to use and redistribute your contributions as
14*8975f5c5SAndroid Build Coastguard Workerpart of the project. Head over to <https://cla.developers.google.com/> to see
15*8975f5c5SAndroid Build Coastguard Workeryour current agreements on file or to sign a new one.
16*8975f5c5SAndroid Build Coastguard Worker
17*8975f5c5SAndroid Build Coastguard WorkerYou generally only need to submit a CLA once, so if you've already submitted one
18*8975f5c5SAndroid Build Coastguard Worker(even if it was for a different project), you probably don't need to do it
19*8975f5c5SAndroid Build Coastguard Workeragain.
20*8975f5c5SAndroid Build Coastguard Worker
21*8975f5c5SAndroid Build Coastguard Worker## Contribution Guidelines
22*8975f5c5SAndroid Build Coastguard Worker
23*8975f5c5SAndroid Build Coastguard WorkerPotential contributors sometimes ask us if the Abseil project is the appropriate
24*8975f5c5SAndroid Build Coastguard Workerhome for their utility library code or for specific functions implementing
25*8975f5c5SAndroid Build Coastguard Workermissing portions of the standard. Often, the answer to this question is "no".
26*8975f5c5SAndroid Build Coastguard WorkerWe’d like to articulate our thinking on this issue so that our choices can be
27*8975f5c5SAndroid Build Coastguard Workerunderstood by everyone and so that contributors can have a better intuition
28*8975f5c5SAndroid Build Coastguard Workerabout whether Abseil might be interested in adopting a new library.
29*8975f5c5SAndroid Build Coastguard Worker
30*8975f5c5SAndroid Build Coastguard Worker### Priorities
31*8975f5c5SAndroid Build Coastguard Worker
32*8975f5c5SAndroid Build Coastguard WorkerAlthough our mission is to augment the C++ standard library, our goal is not to
33*8975f5c5SAndroid Build Coastguard Workerprovide a full forward-compatible implementation of the latest standard. For us
34*8975f5c5SAndroid Build Coastguard Workerto consider a library for inclusion in Abseil, it is not enough that a library
35*8975f5c5SAndroid Build Coastguard Workeris useful. We generally choose to release a library when it meets at least one
36*8975f5c5SAndroid Build Coastguard Workerof the following criteria:
37*8975f5c5SAndroid Build Coastguard Worker
38*8975f5c5SAndroid Build Coastguard Worker*   **Widespread usage** - Using our internal codebase to help gauge usage, most
39*8975f5c5SAndroid Build Coastguard Worker    of the libraries we've released have tens of thousands of users.
40*8975f5c5SAndroid Build Coastguard Worker*   **Anticipated widespread usage** - Pre-adoption of some standard-compliant
41*8975f5c5SAndroid Build Coastguard Worker    APIs may not have broad adoption initially but can be expected to pick up
42*8975f5c5SAndroid Build Coastguard Worker    usage when it replaces legacy APIs. `absl::from_chars`, for example,
43*8975f5c5SAndroid Build Coastguard Worker    replaces existing code that converts strings to numbers and will therefore
44*8975f5c5SAndroid Build Coastguard Worker    likely see usage growth.
45*8975f5c5SAndroid Build Coastguard Worker*   **High impact** - APIs that provide a key solution to a specific problem,
46*8975f5c5SAndroid Build Coastguard Worker    such as `absl::FixedArray`, have higher impact than usage numbers may signal
47*8975f5c5SAndroid Build Coastguard Worker    and are released because of their importance.
48*8975f5c5SAndroid Build Coastguard Worker*   **Direct support for a library that falls under one of the above** - When we
49*8975f5c5SAndroid Build Coastguard Worker    want access to a smaller library as an implementation detail for a
50*8975f5c5SAndroid Build Coastguard Worker    higher-priority library we plan to release, we may release it, as we did
51*8975f5c5SAndroid Build Coastguard Worker    with portions of `absl/meta/type_traits.h`. One consequence of this is that
52*8975f5c5SAndroid Build Coastguard Worker    the presence of a library in Abseil does not necessarily mean that other
53*8975f5c5SAndroid Build Coastguard Worker    similar libraries would be a high priority.
54*8975f5c5SAndroid Build Coastguard Worker
55*8975f5c5SAndroid Build Coastguard Worker### API Freeze Consequences
56*8975f5c5SAndroid Build Coastguard Worker
57*8975f5c5SAndroid Build Coastguard WorkerVia the
58*8975f5c5SAndroid Build Coastguard Worker[Abseil Compatibility Guidelines](https://abseil.io/about/compatibility), we
59*8975f5c5SAndroid Build Coastguard Workerhave promised a large degree of API stability. In particular, we will not make
60*8975f5c5SAndroid Build Coastguard Workerbackward-incompatible changes to released APIs without also shipping a tool or
61*8975f5c5SAndroid Build Coastguard Workerprocess that can upgrade our users' code. We are not yet at the point of easily
62*8975f5c5SAndroid Build Coastguard Workerreleasing such tools. Therefore, at this time, shipping a library establishes an
63*8975f5c5SAndroid Build Coastguard WorkerAPI contract which is borderline unchangeable. (We can add new functionality,
64*8975f5c5SAndroid Build Coastguard Workerbut we cannot easily change existing behavior.) This constraint forces us to
65*8975f5c5SAndroid Build Coastguard Workervery carefully review all APIs that we ship.
66*8975f5c5SAndroid Build Coastguard Worker
67*8975f5c5SAndroid Build Coastguard Worker
68*8975f5c5SAndroid Build Coastguard Worker## Coding Style
69*8975f5c5SAndroid Build Coastguard Worker
70*8975f5c5SAndroid Build Coastguard WorkerTo keep the source consistent, readable, diffable and easy to merge, we use a
71*8975f5c5SAndroid Build Coastguard Workerfairly rigid coding style, as defined by the
72*8975f5c5SAndroid Build Coastguard Worker[google-styleguide](https://github.com/google/styleguide) project. All patches
73*8975f5c5SAndroid Build Coastguard Workerwill be expected to conform to the style outlined
74*8975f5c5SAndroid Build Coastguard Worker[here](https://google.github.io/styleguide/cppguide.html).
75*8975f5c5SAndroid Build Coastguard Worker
76*8975f5c5SAndroid Build Coastguard Worker## Guidelines for Pull Requests
77*8975f5c5SAndroid Build Coastguard Worker
78*8975f5c5SAndroid Build Coastguard Worker*   If you are a Googler, it is required that you send us a Piper CL instead of
79*8975f5c5SAndroid Build Coastguard Worker    using the GitHub pull-request process. The code propagation process will
80*8975f5c5SAndroid Build Coastguard Worker    deliver the change to GitHub.
81*8975f5c5SAndroid Build Coastguard Worker
82*8975f5c5SAndroid Build Coastguard Worker*   Create **small PRs** that are narrowly focused on **addressing a single
83*8975f5c5SAndroid Build Coastguard Worker    concern**. We often receive PRs that are trying to fix several things at a
84*8975f5c5SAndroid Build Coastguard Worker    time, but if only one fix is considered acceptable, nothing gets merged and
85*8975f5c5SAndroid Build Coastguard Worker    both author's & review's time is wasted. Create more PRs to address
86*8975f5c5SAndroid Build Coastguard Worker    different concerns and everyone will be happy.
87*8975f5c5SAndroid Build Coastguard Worker
88*8975f5c5SAndroid Build Coastguard Worker*   For speculative changes, consider opening an [Abseil
89*8975f5c5SAndroid Build Coastguard Worker    issue](https://github.com/abseil/abseil-cpp/issues) and discussing it first.
90*8975f5c5SAndroid Build Coastguard Worker    If you are suggesting a behavioral or API change, consider starting with an
91*8975f5c5SAndroid Build Coastguard Worker    [Abseil proposal template](ABSEIL_ISSUE_TEMPLATE.md).
92*8975f5c5SAndroid Build Coastguard Worker
93*8975f5c5SAndroid Build Coastguard Worker*   Provide a good **PR description** as a record of **what** change is being
94*8975f5c5SAndroid Build Coastguard Worker    made and **why** it was made. Link to a GitHub issue if it exists.
95*8975f5c5SAndroid Build Coastguard Worker
96*8975f5c5SAndroid Build Coastguard Worker*   Don't fix code style and formatting unless you are already changing that
97*8975f5c5SAndroid Build Coastguard Worker    line to address an issue. Formatting of modified lines may be done using
98*8975f5c5SAndroid Build Coastguard Worker   `git clang-format`. PRs with irrelevant changes won't be merged. If
99*8975f5c5SAndroid Build Coastguard Worker    you do want to fix formatting or style, do that in a separate PR.
100*8975f5c5SAndroid Build Coastguard Worker
101*8975f5c5SAndroid Build Coastguard Worker*   Unless your PR is trivial, you should expect there will be reviewer comments
102*8975f5c5SAndroid Build Coastguard Worker    that you'll need to address before merging. We expect you to be reasonably
103*8975f5c5SAndroid Build Coastguard Worker    responsive to those comments, otherwise the PR will be closed after 2-3
104*8975f5c5SAndroid Build Coastguard Worker    weeks of inactivity.
105*8975f5c5SAndroid Build Coastguard Worker
106*8975f5c5SAndroid Build Coastguard Worker*   Maintain **clean commit history** and use **meaningful commit messages**.
107*8975f5c5SAndroid Build Coastguard Worker    PRs with messy commit history are difficult to review and won't be merged.
108*8975f5c5SAndroid Build Coastguard Worker    Use `rebase -i upstream/master` to curate your commit history and/or to
109*8975f5c5SAndroid Build Coastguard Worker    bring in latest changes from master (but avoid rebasing in the middle of a
110*8975f5c5SAndroid Build Coastguard Worker    code review).
111*8975f5c5SAndroid Build Coastguard Worker
112*8975f5c5SAndroid Build Coastguard Worker*   Keep your PR up to date with upstream/master (if there are merge conflicts,
113*8975f5c5SAndroid Build Coastguard Worker    we can't really merge your change).
114*8975f5c5SAndroid Build Coastguard Worker
115*8975f5c5SAndroid Build Coastguard Worker*   **All tests need to be passing** before your change can be merged. We
116*8975f5c5SAndroid Build Coastguard Worker    recommend you **run tests locally** (see below)
117*8975f5c5SAndroid Build Coastguard Worker
118*8975f5c5SAndroid Build Coastguard Worker*   Exceptions to the rules can be made if there's a compelling reason for doing
119*8975f5c5SAndroid Build Coastguard Worker    so. That is - the rules are here to serve us, not the other way around, and
120*8975f5c5SAndroid Build Coastguard Worker    the rules need to be serving their intended purpose to be valuable.
121*8975f5c5SAndroid Build Coastguard Worker
122*8975f5c5SAndroid Build Coastguard Worker*   All submissions, including submissions by project members, require review.
123*8975f5c5SAndroid Build Coastguard Worker
124*8975f5c5SAndroid Build Coastguard Worker## Running Tests
125*8975f5c5SAndroid Build Coastguard Worker
126*8975f5c5SAndroid Build Coastguard WorkerIf you have [Bazel](https://bazel.build/) installed, use `bazel test
127*8975f5c5SAndroid Build Coastguard Worker--test_tag_filters="-benchmark" ...` to run the unit tests.
128*8975f5c5SAndroid Build Coastguard Worker
129*8975f5c5SAndroid Build Coastguard WorkerIf you are running the Linux operating system and have
130*8975f5c5SAndroid Build Coastguard Worker[Docker](https://www.docker.com/) installed, you can also run the `linux_*.sh`
131*8975f5c5SAndroid Build Coastguard Workerscripts under the `ci/`(https://github.com/abseil/abseil-cpp/tree/master/ci)
132*8975f5c5SAndroid Build Coastguard Workerdirectory to test Abseil under a variety of conditions.
133*8975f5c5SAndroid Build Coastguard Worker
134*8975f5c5SAndroid Build Coastguard Worker## Abseil Committers
135*8975f5c5SAndroid Build Coastguard Worker
136*8975f5c5SAndroid Build Coastguard WorkerThe current members of the Abseil engineering team are the only committers at
137*8975f5c5SAndroid Build Coastguard Workerpresent.
138*8975f5c5SAndroid Build Coastguard Worker
139*8975f5c5SAndroid Build Coastguard Worker## Release Process
140*8975f5c5SAndroid Build Coastguard Worker
141*8975f5c5SAndroid Build Coastguard WorkerAbseil lives at head, where latest-and-greatest code can be found.
142