@@ -182,63 +182,72 @@ a 1.23.1 tag also existed at the time. The bump to libmongoc 1.23.1 was left to
182
182
another PHPC ticket in the 1.15.0 milestone, which actually depended on the
183
183
libmongoc changes therein.
184
184
185
- ### Updating libmongoc and libbson
185
+ ### Updating bundled libraries
186
186
187
- #### Update libmongoc submodule
187
+ The following steps are the same for libmongoc and libmongocrypt. When updating
188
+ libmongocrypt, follow the same steps but replace ` libmongoc ` with
189
+ ` libmongocrypt ` , retaining the same capitalization. The following examples
190
+ always refer to libmongoc.
188
191
189
- ```
190
- $ cd src/libmongoc
191
- $ git fetch
192
- $ git checkout 1.20.0
192
+ #### Update submodule
193
+
194
+ ``` shell
195
+ cd src/libmongoc
196
+ git fetch
197
+ git checkout 1.20.0
193
198
```
194
199
195
- During development, it may be necessary to temporarily point the libmongoc
196
- submodule to a commit on the developer's fork of libmongoc. For instance, the
197
- developer may be working on a PHP driver feature that depends on an unmerged
198
- pull request to libmongoc. In this case, ` git remote add ` can be used to add
199
- the fork before fetching and checking out the target commit. Additionally, the
200
- submodule path in
201
- [ ` .gitmodules ` ] ( https://github.com/mongodb/mongo-php-driver/blob/master/.gitmodules )
202
- must also be updated to refer to the fork.
200
+ During development, it may be necessary to temporarily point the submodule to a
201
+ commit on the developer's fork. For instance, the developer may be working on a
202
+ PHP driver feature that depends on unmerged or unreleased changes. In this case,
203
+ the submodule path can be updated using the ` git submodules set-url ` command can
204
+ be used to change the URL, and ` git submodules set-branch ` can be used to point
205
+ the submodule to a development branch:
203
206
204
- #### Ensure libmongoc version information is correct
207
+ ``` shell
208
+ git submodules set-url src/libmongoc https://github.com/< owner> /< repo> .git
209
+ git submodules set-branch -b < branch> src/libmongoc
210
+ ```
205
211
206
- The build process for Autotools and Windows rely on
207
- ` src/LIBMONGOC_VERSION_CURRENT ` to infer version information for libmongoc and
208
- libbson. This file can be regenerated using the following Makefile target:
212
+ #### Ensure version information is correct
209
213
210
- ```
211
- $ make libmongoc-version-current
214
+ Various build processes and tools rely on the version files to infer version
215
+ information. This file can be regenerated using Makefile targets:
216
+
217
+ ``` shell
218
+ make libmongoc-version-current
212
219
```
213
220
214
- Alternatively, the ` build/calc_release_version.py ` script in libmongoc can be
215
- executed directly.
221
+ Alternatively, the ` build/calc_release_version.py ` script in the submodule can
222
+ be executed directly.
216
223
217
- Note: If the libmongoc submodule points to a non-release, non-master branch, the
218
- script may fail to correctly detect the version. This issue is being tracked in
219
- [ CDRIVER-3315] ( https://jira.mongodb.org/browse/CDRIVER-3315 ) and can be safely
220
- ignored since this should only happen during development (any PHP driver release
221
- should point to a tagged libmongoc release ).
224
+ Note: If the submodule points to a non-release, non-master branch, the script
225
+ may fail to correctly detect the version. This issue is being tracked in
226
+ [ CDRIVER-3315] ( https://jira.mongodb.org/browse/CDRIVER-3315 ) and can be safely ignored since this should only happen
227
+ during development (any PHP driver release should point to a tagged submodule
228
+ version ).
222
229
223
230
#### Update sources in build configurations
224
231
225
232
The Autotools and Windows build configurations (` config.m4 ` and ` config.w32 ` ,
226
233
respectively) define several variables (e.g. ` PHP_MONGODB_MONGOC_SOURCES ` ) that
227
- collectively enumerate all of the the sources within the libmongoc submodule to
228
- include in a bundled build.
234
+ collectively enumerate all of the sources within the submodules to include in a
235
+ bundled build.
229
236
230
237
These variables should each have a shell command in a preceding comment, which
231
238
should be run to regenerate that particular list of source files. Each command
232
239
may be run manually or ` scripts/update-submodule-sources.php ` may be used to
233
- update all variables. In the event that either libmongoc or libbson introduce a
234
- new source directory, that will need to be manually added (follow prior art) .
240
+ update all variables. In the event that a new source directory is introduced,
241
+ this directory will need to be manually added following prior art.
235
242
236
243
#### Update package dependencies
237
244
238
245
The Autotools configuration additionally includes some ` pkg-config ` commands for
239
- using libmongoc and libbson as system libraries (in lieu of a bundled build).
240
- When bumping the libmongoc version, be sure to update the version check _ and_
241
- error message in the ` pkg-config ` blocks for both libmongoc and libbson.
246
+ using libmongoc, libbson, and libmongocrypt as system libraries (in lieu of a
247
+ bundled build). When bumping the bundled version, be sure to update the version
248
+ check _ and_ error message in the ` pkg-config ` blocks for the submodule being
249
+ updated. When updating libmongoc, be sure to update both version checks for
250
+ libmongoc and libbson.
242
251
243
252
For example, the following lines might be updated for libmongoc:
244
253
@@ -250,7 +259,7 @@ if $PKG_CONFIG libmongoc-1.0 --atleast-version 1.20.0; then
250
259
AC_MSG_ERROR(system libmongoc must be upgraded to version >= 1.20.0)
251
260
```
252
261
253
- #### Update tested versions in Evergreen configuration
262
+ #### Update tested versions in Evergreen configuration (libmongoc only)
254
263
255
264
Evergreen tests against multiple versions of libmongoc. When updating to a newer
256
265
libmongoc version, make sure to update the libmongoc build tasks in ` .evergreen/config/templates/build/build-libmongoc.yml `
@@ -264,32 +273,30 @@ against two additional versions of libmongoc:
264
273
265
274
#### Update sources in PECL package generation script
266
275
267
- If either libmongoc or libbson introduce a new source directory, that may also
276
+ If a new version of a submodule introduces a new source directory, that may also
268
277
require updating the glob patterns in the ` bin/prep-release.php ` script to
269
278
ensure new source files will be included in any generated PECL package.
270
279
271
- #### Test and commit your changes
280
+ #### Update SBOM file
272
281
273
- Verify that the upgrade was successful by ensuring that the driver can compile
274
- using both the bundled sources and system libraries for libmongoc and libbson,
275
- and by ensuring that the test suite passes. Once done, commit the changes to all
276
- of the above files/paths. For example:
282
+ After updating dependencies, the SBOM file needs to be updated. There is a
283
+ script to automate this process:
277
284
278
- ```
279
- $ git commit -m "Bump libmongoc to 1.20.0" config.m4 config.w32 src/libmongoc src/LIBMONGOC_VERSION_CURRENT
285
+ ``` shell
286
+ ./scripts/update-sbom.sh
280
287
```
281
288
282
- ### Updating libmongocrypt
289
+ This script will generate a temporary purl file with our dependencies, then run
290
+ the internal silkbomb tool to update the SBOM. Note that you need to have docker
291
+ installed in order to run this.
283
292
284
- To update libmongocrypt, the steps are similar to the above:
293
+ #### Test and commit your changes
285
294
286
- ```
287
- $ cd src/libmongocrypt
288
- $ git fetch
289
- $ git checkout 1.3.0
290
- $ make libmongocrypt-version-current
291
- ```
295
+ Verify that the upgrade was successful by ensuring that the driver can compile
296
+ using both the bundled sources and system libraries, and by ensuring that the
297
+ test suite passes. Once done, commit the changes to all of the above
298
+ files/paths. For example:
292
299
293
- Package dependencies in ` config.m4 ` must also be updated (either manually or
294
- with ` scripts/update-submodule-sources.php ` ), as do the sources in the PECL
295
- generation script.
300
+ ``` shell
301
+ git commit -m " Bump libmongoc to 1.20.0 " config.m4 config.w32 src/libmongoc src/LIBMONGOC_VERSION_CURRENT sbom.json
302
+ ```
0 commit comments