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