|
| 1 | +# Maintaining c-ares |
| 2 | + |
| 3 | +Updates to the c-ares dependency involve the following steps: |
| 4 | + |
| 5 | +1. Downloading the source archive for the new version. |
| 6 | +2. Unpacking the source in a temporary workspace directory. |
| 7 | +3. Removing the `test` directory (to save disk space). |
| 8 | +4. Copying over the existing `.gitignore`, pre-generated `config` directory and |
| 9 | + `cares.gyp` files. |
| 10 | +5. Replacing the existing `deps/cares` with the workspace directory. |
| 11 | +6. Modifying the `cares.gyp` file for file additions/deletions. |
| 12 | +7. Rebuilding the main Node.js `LICENSE`. |
| 13 | + |
| 14 | +## Running the update script |
| 15 | + |
| 16 | +The `tools/update-cares.sh` script automates the update of the c-ares source |
| 17 | +files, preserving the existing files added by Node.js. |
| 18 | + |
| 19 | +In the following examples, `x.y.z` should match the c-ares version to update to. |
| 20 | + |
| 21 | +```console |
| 22 | +./tools/update-cares.sh x.y.z |
| 23 | +``` |
| 24 | + |
| 25 | +e.g. |
| 26 | + |
| 27 | +```console |
| 28 | +./tools/update-cares.sh 1.18.1 |
| 29 | +``` |
| 30 | + |
| 31 | +## Check that Node.js still builds and tests |
| 32 | + |
| 33 | +It may be necessary to update `deps/cares/cares.gyp` if any significant changes |
| 34 | +have occurred upstream. |
| 35 | + |
| 36 | +## Rebuild the main Node.js license |
| 37 | + |
| 38 | +Run the `tools/license-builder.sh` script to rebuild the main Node.js `LICENSE` |
| 39 | +file. This may result in no changes if c-ares' license has not changed. |
| 40 | + |
| 41 | +```console |
| 42 | +./tools/license-builder.sh |
| 43 | +``` |
| 44 | + |
| 45 | +If the updated `LICENSE` contains changes for other dependencies, those should |
| 46 | +be done in a separate pull request first. |
| 47 | + |
| 48 | +## Commit the changes |
| 49 | + |
| 50 | +```console |
| 51 | +git add -A deps/cares |
| 52 | +``` |
| 53 | + |
| 54 | +Add the rebuilt `LICENSE` if it has been updated. |
| 55 | + |
| 56 | +```console |
| 57 | +git add LICENSE |
| 58 | +``` |
| 59 | + |
| 60 | +Commit the changes with a message like |
| 61 | + |
| 62 | +```text |
| 63 | +deps: update c-ares to x.y.z |
| 64 | +
|
| 65 | +Updated as described in doc/guides/maintaining-c-ares.md. |
| 66 | +``` |
0 commit comments