couchbase 4.4.2 → 4.4.4
Sign up to get free protection for your applications and to get access to all the features.
- package/BUILDING.md +182 -0
- package/CMakeLists.txt +13 -0
- package/CONTRIBUTING.md +1 -1
- package/README.md +4 -2
- package/deps/couchbase-cxx-cache/boringssl/e31ea00c1ea52052d2d78d44006cc88c80fa24a9/boringssl/src/BUILDING.md +206 -0
- package/deps/couchbase-cxx-client/CMakeLists.txt +18 -13
- package/deps/couchbase-cxx-client/README.md +2 -2
- package/deps/couchbase-cxx-client/cmake/APKBUILD.in +54 -0
- package/deps/couchbase-cxx-client/cmake/CompilerWarnings.cmake +0 -5
- package/deps/couchbase-cxx-client/cmake/Packaging.cmake +177 -10
- package/deps/couchbase-cxx-client/cmake/RPath.cmake +10 -0
- package/deps/couchbase-cxx-client/cmake/Testing.cmake +1 -1
- package/deps/couchbase-cxx-client/cmake/VersionInfo.cmake +28 -2
- package/deps/couchbase-cxx-client/cmake/build_version.hxx.in +1 -0
- package/deps/couchbase-cxx-client/cmake/couchbase-cxx-client.spec.in +45 -6
- package/deps/couchbase-cxx-client/cmake/couchbase_cxx_client.pc.in +2 -2
- package/deps/couchbase-cxx-client/cmake/debian/changelog.in +5 -0
- package/deps/couchbase-cxx-client/cmake/debian/compat +1 -0
- package/deps/couchbase-cxx-client/cmake/debian/control +40 -0
- package/deps/couchbase-cxx-client/cmake/debian/rules +41 -0
- package/deps/couchbase-cxx-client/cmake/debian/source/format +1 -0
- package/deps/couchbase-cxx-client/core/agent_group.cxx +8 -0
- package/deps/couchbase-cxx-client/core/agent_group.hxx +4 -0
- package/deps/couchbase-cxx-client/core/bucket.cxx +16 -20
- package/deps/couchbase-cxx-client/core/bucket.hxx +12 -12
- package/deps/couchbase-cxx-client/core/cluster.cxx +44 -52
- package/deps/couchbase-cxx-client/core/cluster_agent.cxx +8 -0
- package/deps/couchbase-cxx-client/core/cluster_agent.hxx +4 -0
- package/deps/couchbase-cxx-client/core/collections_component.cxx +2 -2
- package/deps/couchbase-cxx-client/core/columnar/agent.cxx +2 -2
- package/deps/couchbase-cxx-client/core/columnar/agent.hxx +1 -1
- package/deps/couchbase-cxx-client/core/columnar/management_component.cxx +3 -3
- package/deps/couchbase-cxx-client/core/columnar/query_component.cxx +103 -45
- package/deps/couchbase-cxx-client/core/columnar/query_component.hxx +1 -0
- package/deps/couchbase-cxx-client/core/free_form_http_request.hxx +8 -0
- package/deps/couchbase-cxx-client/core/http_component.cxx +55 -24
- package/deps/couchbase-cxx-client/core/http_component.hxx +4 -0
- package/deps/couchbase-cxx-client/core/impl/analytics.cxx +1 -0
- package/deps/couchbase-cxx-client/core/impl/analytics_index_manager.cxx +15 -15
- package/deps/couchbase-cxx-client/core/impl/bootstrap_error.hxx +10 -2
- package/deps/couchbase-cxx-client/core/impl/bucket.cxx +1 -1
- package/deps/couchbase-cxx-client/core/impl/bucket_manager.cxx +6 -6
- package/deps/couchbase-cxx-client/core/impl/cluster.cxx +36 -40
- package/deps/couchbase-cxx-client/core/impl/collection.cxx +29 -5
- package/deps/couchbase-cxx-client/core/impl/collection_manager.cxx +5 -5
- package/deps/couchbase-cxx-client/core/impl/error.cxx +24 -3
- package/deps/couchbase-cxx-client/core/impl/get_replica.hxx +2 -0
- package/deps/couchbase-cxx-client/core/impl/lookup_in_replica.hxx +2 -0
- package/deps/couchbase-cxx-client/core/impl/observe_poll.cxx +13 -5
- package/deps/couchbase-cxx-client/core/impl/observe_poll.hxx +1 -3
- package/deps/couchbase-cxx-client/core/impl/observe_seqno.hxx +2 -0
- package/deps/couchbase-cxx-client/core/impl/query.cxx +1 -0
- package/deps/couchbase-cxx-client/core/impl/query_index_manager.cxx +6 -6
- package/deps/couchbase-cxx-client/core/impl/scan_result.cxx +1 -1
- package/deps/couchbase-cxx-client/core/impl/search.cxx +2 -0
- package/deps/couchbase-cxx-client/core/impl/search_index_manager.cxx +12 -12
- package/deps/couchbase-cxx-client/core/io/http_command.hxx +31 -20
- package/deps/couchbase-cxx-client/core/io/http_session.cxx +5 -0
- package/deps/couchbase-cxx-client/core/io/http_session.hxx +17 -4
- package/deps/couchbase-cxx-client/core/io/http_session_manager.hxx +97 -49
- package/deps/couchbase-cxx-client/core/io/mcbp_command.hxx +15 -14
- package/deps/couchbase-cxx-client/core/io/mcbp_session.cxx +48 -33
- package/deps/couchbase-cxx-client/core/io/streams.cxx +256 -0
- package/deps/couchbase-cxx-client/core/io/streams.hxx +31 -155
- package/deps/couchbase-cxx-client/core/logger/configuration.hxx +5 -0
- package/deps/couchbase-cxx-client/core/logger/custom_rotating_file_sink.cxx +2 -3
- package/deps/couchbase-cxx-client/core/logger/logger.cxx +39 -7
- package/deps/couchbase-cxx-client/core/logger/logger.hxx +7 -0
- package/deps/couchbase-cxx-client/core/meta/features.hxx +11 -0
- package/deps/couchbase-cxx-client/core/meta/version.cxx +47 -6
- package/deps/couchbase-cxx-client/core/metrics/meter_wrapper.cxx +188 -0
- package/deps/couchbase-cxx-client/core/metrics/meter_wrapper.hxx +73 -0
- package/deps/couchbase-cxx-client/core/operations/document_analytics.cxx +23 -17
- package/deps/couchbase-cxx-client/core/operations/document_analytics.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/document_append.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_decrement.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_exists.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_get.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_get_all_replicas.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_get_and_lock.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_get_and_touch.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_get_any_replica.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_get_projected.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_increment.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_insert.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_lookup_in.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_lookup_in_all_replicas.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_lookup_in_any_replica.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_mutate_in.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_prepend.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_query.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/document_remove.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_replace.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_search.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/document_touch.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_unlock.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_upsert.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_view.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/http_noop.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_dataset_create.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_dataset_drop.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_dataset_get_all.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_dataverse_create.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_dataverse_drop.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_get_pending_mutations.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_index_create.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_index_drop.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_index_get_all.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_link_connect.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_link_create.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_link_disconnect.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_link_drop.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_link_get_all.cxx +23 -15
- package/deps/couchbase-cxx-client/core/operations/management/analytics_link_get_all.hxx +4 -3
- package/deps/couchbase-cxx-client/core/operations/management/analytics_link_replace.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/bucket_create.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/bucket_describe.cxx +2 -1
- package/deps/couchbase-cxx-client/core/operations/management/bucket_describe.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/bucket_drop.cxx +3 -1
- package/deps/couchbase-cxx-client/core/operations/management/bucket_drop.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/bucket_flush.cxx +3 -1
- package/deps/couchbase-cxx-client/core/operations/management/bucket_flush.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/bucket_get.cxx +3 -1
- package/deps/couchbase-cxx-client/core/operations/management/bucket_get.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/bucket_get_all.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/bucket_update.cxx +3 -1
- package/deps/couchbase-cxx-client/core/operations/management/bucket_update.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/change_password.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/cluster_describe.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/cluster_developer_preview_enable.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/collection_create.cxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/collection_create.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/collection_drop.cxx +5 -2
- package/deps/couchbase-cxx-client/core/operations/management/collection_drop.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/collection_update.cxx +4 -2
- package/deps/couchbase-cxx-client/core/operations/management/collection_update.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/collections_manifest_get.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/eventing_deploy_function.hxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/eventing_drop_function.hxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/eventing_get_all_functions.hxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/eventing_get_function.hxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/eventing_get_status.hxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/eventing_pause_function.hxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/eventing_resume_function.hxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/eventing_undeploy_function.hxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/eventing_upsert_function.hxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/freeform.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/group_drop.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/group_get.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/group_get_all.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/group_upsert.cxx +3 -3
- package/deps/couchbase-cxx-client/core/operations/management/group_upsert.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/query_index_build.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/query_index_build_deferred.hxx +3 -0
- package/deps/couchbase-cxx-client/core/operations/management/query_index_create.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/query_index_drop.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/query_index_get_all.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/query_index_get_all_deferred.hxx +3 -0
- package/deps/couchbase-cxx-client/core/operations/management/role_get_all.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/scope_create.cxx +2 -1
- package/deps/couchbase-cxx-client/core/operations/management/scope_create.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/scope_drop.cxx +4 -1
- package/deps/couchbase-cxx-client/core/operations/management/scope_drop.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/scope_get_all.cxx +3 -1
- package/deps/couchbase-cxx-client/core/operations/management/scope_get_all.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_get_stats.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_analyze_document.cxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/search_index_analyze_document.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_control_ingest.cxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/search_index_control_ingest.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_control_plan_freeze.cxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/search_index_control_plan_freeze.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_control_query.cxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/search_index_control_query.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_drop.cxx +5 -2
- package/deps/couchbase-cxx-client/core/operations/management/search_index_drop.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_get.cxx +5 -2
- package/deps/couchbase-cxx-client/core/operations/management/search_index_get.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_get_all.cxx +4 -2
- package/deps/couchbase-cxx-client/core/operations/management/search_index_get_all.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_get_documents_count.cxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/search_index_get_documents_count.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_get_stats.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_upsert.cxx +5 -2
- package/deps/couchbase-cxx-client/core/operations/management/search_index_upsert.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/user_drop.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/user_get.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/user_get_all.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/user_upsert.cxx +3 -3
- package/deps/couchbase-cxx-client/core/operations/management/user_upsert.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/view_index_drop.cxx +2 -1
- package/deps/couchbase-cxx-client/core/operations/management/view_index_drop.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/view_index_get.cxx +2 -1
- package/deps/couchbase-cxx-client/core/operations/management/view_index_get.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/view_index_get_all.cxx +3 -1
- package/deps/couchbase-cxx-client/core/operations/management/view_index_get_all.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/view_index_upsert.cxx +2 -1
- package/deps/couchbase-cxx-client/core/operations/management/view_index_upsert.hxx +1 -0
- package/deps/couchbase-cxx-client/core/origin.cxx +37 -17
- package/deps/couchbase-cxx-client/core/platform/base64.cc +1 -1
- package/deps/couchbase-cxx-client/core/platform/random.cc +2 -0
- package/deps/couchbase-cxx-client/core/platform/uuid.h +6 -6
- package/deps/couchbase-cxx-client/core/row_streamer.cxx +1 -1
- package/deps/couchbase-cxx-client/core/sasl/scram-sha/stringutils.cc +1 -1
- package/deps/couchbase-cxx-client/core/sasl/scram-sha/stringutils.h +4 -4
- package/deps/couchbase-cxx-client/core/topology/configuration.hxx +2 -0
- package/deps/couchbase-cxx-client/core/topology/configuration_json.hxx +8 -0
- package/deps/couchbase-cxx-client/core/tracing/constants.hxx +3 -0
- package/deps/couchbase-cxx-client/core/tracing/tracer_wrapper.cxx +87 -0
- package/deps/couchbase-cxx-client/core/tracing/tracer_wrapper.hxx +57 -0
- package/deps/couchbase-cxx-client/core/transactions/async_attempt_context.hxx +9 -21
- package/deps/couchbase-cxx-client/core/transactions/attempt_context.hxx +6 -33
- package/deps/couchbase-cxx-client/core/transactions/attempt_context_impl.cxx +57 -56
- package/deps/couchbase-cxx-client/core/transactions/attempt_context_impl.hxx +17 -18
- package/deps/couchbase-cxx-client/core/transactions/staged_mutation.cxx +2 -2
- package/deps/couchbase-cxx-client/core/transactions/transaction_context.cxx +2 -2
- package/deps/couchbase-cxx-client/core/transactions/transaction_get_result.hxx +0 -20
- package/deps/couchbase-cxx-client/core/transactions/transactions.cxx +2 -2
- package/deps/couchbase-cxx-client/core/utils/connection_string.cxx +128 -52
- package/deps/couchbase-cxx-client/couchbase/analytics_options.hxx +4 -3
- package/deps/couchbase-cxx-client/couchbase/codec/tao_json_serializer.hxx +1 -1
- package/deps/couchbase-cxx-client/couchbase/common_options.hxx +16 -1
- package/deps/couchbase-cxx-client/couchbase/metrics/otel_meter.hxx +16 -20
- package/deps/couchbase-cxx-client/couchbase/mutate_in_specs.hxx +2 -2
- package/deps/couchbase-cxx-client/couchbase/query_options.hxx +4 -3
- package/deps/couchbase-cxx-client/couchbase/search_options.hxx +1 -1
- package/dist/analyticsindexmanager.d.ts +98 -14
- package/dist/analyticsindexmanager.js +452 -411
- package/dist/binding.d.ts +53 -4
- package/dist/bindingutilities.d.ts +26 -1
- package/dist/bindingutilities.js +108 -1
- package/dist/couchbase.d.ts +3 -1
- package/dist/couchbase.js +2 -0
- package/dist/rangeScan.d.ts +1 -1
- package/dist/rangeScan.js +1 -1
- package/dist/transactions.d.ts +34 -3
- package/dist/transactions.js +25 -18
- package/dist/transcoders.d.ts +68 -0
- package/dist/transcoders.js +194 -1
- package/dist/usermanager.d.ts +14 -14
- package/dist/usermanager.js +178 -228
- package/dist/utilities.js +4 -6
- package/dist/utilities_internal.js +1 -2
- package/package.json +9 -8
- package/src/binding.cpp +13 -13
- package/src/connection.cpp +22 -0
- package/src/connection.hpp +12 -0
- package/src/connection_autogen.cpp +100 -0
- package/src/jstocbpp_autogen.hpp +315 -8
- package/src/jstocbpp_transactions.hpp +1 -2
- package/tools/gen-bindings-js.js +38 -3
- package/tools/gen-bindings-json.py +575 -328
package/BUILDING.md
ADDED
@@ -0,0 +1,182 @@
|
|
1
|
+
# Setup
|
2
|
+
|
3
|
+
Make sure to have cloned the [SDK repository](https://github.com/couchbase/couchnode.git) and have the submodules appropriately synced (`git submodule update --init --recursive`).
|
4
|
+
|
5
|
+
# Building
|
6
|
+
|
7
|
+
## Set CPM Cache
|
8
|
+
The C++ core utilizes the CMake Package Manager (CPM) to include depencies. These can be set to a cache directory and can be used for future builds. Periodically the dependencies should be updated. So, in general it is good practice to configure the build environment by setting the CPM cache.
|
9
|
+
|
10
|
+
### Via npm command
|
11
|
+
```console
|
12
|
+
npm run prebuild -- --configure --set-cpm-cache --use-boringssl
|
13
|
+
```
|
14
|
+
|
15
|
+
### Available Options
|
16
|
+
>Note: Section under construction
|
17
|
+
|
18
|
+
### Via cmake-js
|
19
|
+
|
20
|
+
Set the cache directory `CXXCBC_CACHE_DIR`:
|
21
|
+
```console
|
22
|
+
export CXXCBC_CACHE_DIR=$PWD/deps/couchbase-cxx-cache
|
23
|
+
```
|
24
|
+
|
25
|
+
Remove the cache directory
|
26
|
+
```console
|
27
|
+
rm -rf $CXXCBC_CACHE_DIR
|
28
|
+
```
|
29
|
+
|
30
|
+
Configure the build:
|
31
|
+
```console
|
32
|
+
$ npx cmake-js configure \
|
33
|
+
--runtime node \
|
34
|
+
--runtime-version $(node --version) \
|
35
|
+
--CDUSE_STATIC_OPENSSL=OFF \
|
36
|
+
--CDCPM_DOWNLOAD_ALL=OFF \
|
37
|
+
--CDCPM_USE_NAMED_CACHE_DIRECTORIES=ON \
|
38
|
+
--CDCPM_USE_LOCAL_PACKAGES=OFF \
|
39
|
+
--CDCPM_SOURCE_CACHE=$CXXCBC_CACHE_DIR
|
40
|
+
```
|
41
|
+
|
42
|
+
## Build the client binary
|
43
|
+
|
44
|
+
### Via npm command
|
45
|
+
```console
|
46
|
+
npm run prebuild -- --use-boringssl
|
47
|
+
```
|
48
|
+
|
49
|
+
### Available Options
|
50
|
+
>Note: Section under construction
|
51
|
+
|
52
|
+
### Via cmake-js
|
53
|
+
|
54
|
+
>NOTE: If using the `compile` command, the build will automatically clean and re-execute a build upon a failure. Use the `build` command to only attempt a single build.
|
55
|
+
|
56
|
+
Set the cache directory (if it has not already been set) `CXXCBC_CACHE_DIR`:
|
57
|
+
```console
|
58
|
+
export CXXCBC_CACHE_DIR=$PWD/deps/couchbase-cxx-cache
|
59
|
+
```
|
60
|
+
|
61
|
+
```console
|
62
|
+
npx cmake-js compile \
|
63
|
+
--runtime node \
|
64
|
+
--runtime-version $(node --version) \
|
65
|
+
--CDUSE_STATIC_OPENSSL=OFF \
|
66
|
+
--CDCPM_DOWNLOAD_ALL=OFF \
|
67
|
+
--CDCPM_USE_NAMED_CACHE_DIRECTORIES=ON \
|
68
|
+
--CDCPM_USE_LOCAL_PACKAGES=OFF \
|
69
|
+
--CDCPM_SOURCE_CACHE=$CXXCBC_CACHE_DIR
|
70
|
+
```
|
71
|
+
|
72
|
+
# Autogen
|
73
|
+
|
74
|
+
>**IMPORTANT**: Autogen is only needed for maintainers of the library. If not making updates to the core bindings, running the autogen tooling should *NOT* be required.
|
75
|
+
|
76
|
+
Move into the `tools` directory prior to running any autogen commands.
|
77
|
+
|
78
|
+
## Python Environment
|
79
|
+
|
80
|
+
>NOTE: Python >= 3.9 required
|
81
|
+
|
82
|
+
Setup virtual env:
|
83
|
+
```console
|
84
|
+
python3 -m venv <path to virtualenv>
|
85
|
+
```
|
86
|
+
Example: `python3 -m venv $(pwd)/couchnode`
|
87
|
+
|
88
|
+
Activate virtual env:
|
89
|
+
```console
|
90
|
+
source <path to virtualenv>/bin/activate
|
91
|
+
```
|
92
|
+
Example: `source $(pwd)/couchnode/bin/activate`
|
93
|
+
|
94
|
+
Install `clang` from PyPI:
|
95
|
+
```console
|
96
|
+
python3 -m pip install clang
|
97
|
+
```
|
98
|
+
|
99
|
+
Generate `bindings.json`. If no arguments are passed in the binding generator will attempt to determine the necessary version, lib directory, include directory and system headers directory.
|
100
|
+
```console
|
101
|
+
python3 gen-bindings-json.py
|
102
|
+
```
|
103
|
+
Alternatively, options can be provided (or ENV variables may be set):
|
104
|
+
```console
|
105
|
+
python gen-bindings-json.py -v $(llvm-config --version) \
|
106
|
+
-i $(llvm-config --includedir) \
|
107
|
+
-l $(llvm-config --libdir) \
|
108
|
+
-s $(xcrun --show-sdk-path)
|
109
|
+
```
|
110
|
+
|
111
|
+
Available Environment Variables:
|
112
|
+
- `CN_LLVM_VERSION`: LLVM version
|
113
|
+
- `CN_LLVM_INCLUDE`: LLVM include directory path
|
114
|
+
- `CN_LLVM_LIB`: LLVM lib directory path
|
115
|
+
- `CN_SYS_HEADERS`: System headers path
|
116
|
+
|
117
|
+
## Node.js
|
118
|
+
|
119
|
+
Populate SDK autogen code sections:
|
120
|
+
```console
|
121
|
+
node gen-bindings.js.js
|
122
|
+
```
|
123
|
+
|
124
|
+
## clean-up
|
125
|
+
### Format C++ source files.
|
126
|
+
|
127
|
+
On MacOS, make sure LLVM clang-format is used (configure the PATH appropriately):
|
128
|
+
```console
|
129
|
+
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
|
130
|
+
```
|
131
|
+
|
132
|
+
>NOTE: Be aware of the current working directory (commands below assume the CWD is `tools`).
|
133
|
+
|
134
|
+
```console
|
135
|
+
clang-format -i ../src/connection.cpp
|
136
|
+
clang-format -i ../src/connection.hpp
|
137
|
+
clang-format -i ../src/connection_autogen.cpp
|
138
|
+
clang-format -i ../src/constants.cpp
|
139
|
+
clang-format -i ../src/jstocbpp_autogen.hpp
|
140
|
+
```
|
141
|
+
### Format Node.js source files.
|
142
|
+
|
143
|
+
>NOTE: Be aware of the current working directory (commands below assume the CWD is `tools`).
|
144
|
+
|
145
|
+
```console
|
146
|
+
npx prettier --write ../lib/binding.ts
|
147
|
+
```
|
148
|
+
|
149
|
+
### Remove bindings.json
|
150
|
+
|
151
|
+
```console
|
152
|
+
rm bindings.json
|
153
|
+
```
|
154
|
+
|
155
|
+
### Format autogen scripts.
|
156
|
+
|
157
|
+
This should rarely be needed (e.g. updating the autogen logic).
|
158
|
+
|
159
|
+
>NOTE: Be aware of the current working directory (commands below assume the CWD is `tools`).
|
160
|
+
|
161
|
+
#### Python
|
162
|
+
|
163
|
+
Install `autopep8` from PyPI:
|
164
|
+
```console
|
165
|
+
python3 -m pip install autopep8
|
166
|
+
```
|
167
|
+
|
168
|
+
```console
|
169
|
+
autopep8 -i -a -a --max-line-length 120 gen-bindings-json.py
|
170
|
+
```
|
171
|
+
|
172
|
+
#### Node.js
|
173
|
+
```console
|
174
|
+
npx prettier --write gen-bindings-js.js
|
175
|
+
```
|
176
|
+
|
177
|
+
If a virtualenv was setup (hopefully it was ;)), deactivate and the environment
|
178
|
+
```console
|
179
|
+
deactivate
|
180
|
+
rm -rf <path to virtualenv>
|
181
|
+
```
|
182
|
+
Example: `deactivate && rm -rf $(pwd)/couchnode`
|
package/CMakeLists.txt
CHANGED
@@ -7,6 +7,13 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|
7
7
|
|
8
8
|
project (couchbase_impl)
|
9
9
|
|
10
|
+
function(get_couchnode_version)
|
11
|
+
execute_process(COMMAND node -e "console.log(JSON.parse(fs.readFileSync('${PROJECT_SOURCE_DIR}/package.json')).version)"
|
12
|
+
OUTPUT_VARIABLE sdk_version)
|
13
|
+
string(STRIP "${sdk_version}" SDK_VERSION)
|
14
|
+
set(COUCHNODE_VERSION "${SDK_VERSION}" PARENT_SCOPE)
|
15
|
+
endfunction()
|
16
|
+
|
10
17
|
function(download_nodejs_headers)
|
11
18
|
message("Finding Node.js headers SHA for version: ${NODE_RUNTIMEVERSION}")
|
12
19
|
file(DOWNLOAD
|
@@ -146,6 +153,10 @@ endif()
|
|
146
153
|
# We need to import headers globally for our dependant libraries such as couchbase-cxx-client.
|
147
154
|
include_directories(${NODEJS_INC_DIR})
|
148
155
|
|
156
|
+
get_couchnode_version()
|
157
|
+
message(STATUS "COUCHNODE_VERSION=${COUCHNODE_VERSION}")
|
158
|
+
|
159
|
+
set(COUCHBASE_CXX_CLIENT_WRAPPER_UNIFIED_ID "nodejs/${COUCHNODE_VERSION}" CACHE STRING "" FORCE)
|
149
160
|
set(COUCHBASE_CXX_CLIENT_BUILD_STATIC ON CACHE BOOL "" FORCE)
|
150
161
|
set(COUCHBASE_CXX_CLIENT_BUILD_SHARED OFF CACHE BOOL "" FORCE)
|
151
162
|
set(COUCHBASE_CXX_CLIENT_BUILD_INSTALL OFF CACHE BOOL "" FORCE)
|
@@ -194,6 +205,7 @@ set(COUCHBASE_CXX_SOURCE_DIR "${PROJECT_SOURCE_DIR}/deps/couchbase-cxx-client")
|
|
194
205
|
if(CMAKE_JS_VERSION VERSION_GREATER_EQUAL "7.0.0")
|
195
206
|
target_include_directories(${PROJECT_NAME}
|
196
207
|
PRIVATE ${NODEJS_INC_DIR}
|
208
|
+
"${COUCHBASE_CXX_BINARY_DIR}/generated"
|
197
209
|
"${COUCHBASE_CXX_SOURCE_DIR}"
|
198
210
|
"${COUCHBASE_CXX_SOURCE_DIR}/third_party/cxx_function"
|
199
211
|
"${COUCHBASE_CXX_SOURCE_DIR}/third_party/expected/include")
|
@@ -208,6 +220,7 @@ else()
|
|
208
220
|
target_include_directories(${PROJECT_NAME}
|
209
221
|
PRIVATE ${NODEJS_INC_DIR}
|
210
222
|
${NODE_ADDON_API_DIR}
|
223
|
+
"${COUCHBASE_CXX_BINARY_DIR}/generated"
|
211
224
|
"${COUCHBASE_CXX_SOURCE_DIR}"
|
212
225
|
"${COUCHBASE_CXX_SOURCE_DIR}/third_party/cxx_function"
|
213
226
|
"${COUCHBASE_CXX_SOURCE_DIR}/third_party/expected/include")
|
package/CONTRIBUTING.md
CHANGED
@@ -25,7 +25,7 @@ Ensure the feature you are adding does not already exist, and think about how th
|
|
25
25
|
|
26
26
|
#### For fixing bugs
|
27
27
|
|
28
|
-
Ensure the bug you are fixing is actually a bug (and not a usage) error, and that it has not been fixed in a more recent version. Please read the [release notes](https://docs.couchbase.com/nodejs-sdk/current/project-docs/sdk-release-notes.html) as well as the [issue tracker](https://issues.couchbase.com/projects/JSCBC/issues/) to see a list of open and resolved issues.
|
28
|
+
Ensure the bug you are fixing is actually a bug (and not a usage) error, and that it has not been fixed in a more recent version. Please read the [release notes](https://docs.couchbase.com/nodejs-sdk/current/project-docs/sdk-release-notes.html) as well as the [issue tracker](https://jira.issues.couchbase.com/projects/JSCBC/issues/) to see a list of open and resolved issues.
|
29
29
|
|
30
30
|
### Code Review
|
31
31
|
|
package/README.md
CHANGED
@@ -9,7 +9,7 @@ protocol.
|
|
9
9
|
|
10
10
|
Source - [https://github.com/couchbase/couchnode](https://github.com/couchbase/couchnode)
|
11
11
|
|
12
|
-
Bug Tracker - [https://
|
12
|
+
Bug Tracker - [https://jira.issues.couchbase.com/projects/JSCBC/issues/](https://jira.issues.couchbase.com/projects/JSCBC/issues/)
|
13
13
|
|
14
14
|
Couchbase Developer Portal - [https://docs.couchbase.com/](https://docs.couchbase.com/nodejs-sdk/3.0/hello-world/start-using-sdk.html)
|
15
15
|
|
@@ -145,6 +145,8 @@ Once you have cloned the repository, you may contribute changes through our
|
|
145
145
|
gerrit server. For more details see
|
146
146
|
[CONTRIBUTING.md](https://github.com/couchbase/couchnode/blob/master/CONTRIBUTING.md).
|
147
147
|
|
148
|
+
To build the client, follow the steps outlined on the [BUILDING page](https://github.com/couchbase/couchnode/blob/main/BUILDING.md)
|
149
|
+
|
148
150
|
To execute our test suite, run `make test` from the root directory.
|
149
151
|
|
150
152
|
To execute our code coverage, run `make cover` from the root directory.
|
@@ -159,7 +161,7 @@ root directory, and a docs folder will be created with the api reference.
|
|
159
161
|
|
160
162
|
# Support & Additional Resources
|
161
163
|
|
162
|
-
If you found an issue, please file it in our [JIRA](https://issues.couchbase.com/projects/JSCBC/issues/).
|
164
|
+
If you found an issue, please file it in our [Github issues](https://github.com/couchbase/couchnode/issues). We will bring over the issue to our [JIRA](https://jira.issues.couchbase.com/projects/JSCBC/issues/) as needed.
|
163
165
|
|
164
166
|
The Couchbase Discord server is a place where you can collaborate about all things Couchbase. Connect with others from the community, learn tips and tricks, and ask questions. [Join Discord and contribute](https://discord.com/invite/sQ5qbPZuTh).
|
165
167
|
|
@@ -0,0 +1,206 @@
|
|
1
|
+
# Building BoringSSL
|
2
|
+
|
3
|
+
## Build Prerequisites
|
4
|
+
|
5
|
+
The standalone CMake build is primarily intended for developers. If embedding
|
6
|
+
BoringSSL into another project with a pre-existing build system, see
|
7
|
+
[INCORPORATING.md](/INCORPORATING.md).
|
8
|
+
|
9
|
+
Unless otherwise noted, build tools must at most five years old, matching
|
10
|
+
[Abseil guidelines](https://abseil.io/about/compatibility). If in doubt, use the
|
11
|
+
most recent stable version of each tool.
|
12
|
+
|
13
|
+
* [CMake](https://cmake.org/download/) 3.10 or later is required.
|
14
|
+
|
15
|
+
* A recent version of Perl is required. On Windows,
|
16
|
+
[Active State Perl](http://www.activestate.com/activeperl/) has been
|
17
|
+
reported to work, as has MSYS Perl.
|
18
|
+
[Strawberry Perl](http://strawberryperl.com/) also works but it adds GCC
|
19
|
+
to `PATH`, which can confuse some build tools when identifying the compiler
|
20
|
+
(removing `C:\Strawberry\c\bin` from `PATH` should resolve any problems).
|
21
|
+
If Perl is not found by CMake, it may be configured explicitly by setting
|
22
|
+
`PERL_EXECUTABLE`.
|
23
|
+
|
24
|
+
* Building with [Ninja](https://ninja-build.org/) instead of Make is
|
25
|
+
recommended, because it makes builds faster. On Windows, CMake's Visual
|
26
|
+
Studio generator may also work, but it not tested regularly and requires
|
27
|
+
recent versions of CMake for assembly support.
|
28
|
+
|
29
|
+
* On Windows only, [NASM](https://www.nasm.us/) is required. If not found
|
30
|
+
by CMake, it may be configured explicitly by setting
|
31
|
+
`CMAKE_ASM_NASM_COMPILER`.
|
32
|
+
|
33
|
+
* C and C++ compilers with C++14 support are required. If using a C compiler
|
34
|
+
other than MSVC, C11 support is also requried. On Windows, MSVC from
|
35
|
+
Visual Studio 2019 or later with Windows 10 SDK 2104 or later are supported,
|
36
|
+
but using the latest versions is recommended. Recent versions of GCC (6.1+)
|
37
|
+
and Clang should work on non-Windows platforms, and maybe on Windows too.
|
38
|
+
|
39
|
+
* The most recent stable version of [Go](https://golang.org/dl/) is required.
|
40
|
+
Note Go is exempt from the five year support window. If not found by CMake,
|
41
|
+
the go executable may be configured explicitly by setting `GO_EXECUTABLE`.
|
42
|
+
|
43
|
+
* On x86_64 Linux, the tests have an optional
|
44
|
+
[libunwind](https://www.nongnu.org/libunwind/) dependency to test the
|
45
|
+
assembly more thoroughly.
|
46
|
+
|
47
|
+
## Building
|
48
|
+
|
49
|
+
Using Ninja (note the 'N' is capitalized in the cmake invocation):
|
50
|
+
|
51
|
+
cmake -GNinja -B build
|
52
|
+
ninja -C build
|
53
|
+
|
54
|
+
Using Make (does not work on Windows):
|
55
|
+
|
56
|
+
cmake -B build
|
57
|
+
make -C build
|
58
|
+
|
59
|
+
You usually don't need to run `cmake` again after changing `CMakeLists.txt`
|
60
|
+
files because the build scripts will detect changes to them and rebuild
|
61
|
+
themselves automatically.
|
62
|
+
|
63
|
+
Note that the default build flags in the top-level `CMakeLists.txt` are for
|
64
|
+
debugging—optimisation isn't enabled. Pass `-DCMAKE_BUILD_TYPE=Release` to
|
65
|
+
`cmake` to configure a release build.
|
66
|
+
|
67
|
+
If you want to cross-compile then there is an example toolchain file for 32-bit
|
68
|
+
Intel in `util/`. Wipe out the build directory, run `cmake` like this:
|
69
|
+
|
70
|
+
cmake -B build -DCMAKE_TOOLCHAIN_FILE=../util/32-bit-toolchain.cmake -GNinja
|
71
|
+
|
72
|
+
If you want to build as a shared library, pass `-DBUILD_SHARED_LIBS=1`. On
|
73
|
+
Windows, where functions need to be tagged with `dllimport` when coming from a
|
74
|
+
shared library, define `BORINGSSL_SHARED_LIBRARY` in any code which `#include`s
|
75
|
+
the BoringSSL headers.
|
76
|
+
|
77
|
+
In order to serve environments where code-size is important as well as those
|
78
|
+
where performance is the overriding concern, `OPENSSL_SMALL` can be defined to
|
79
|
+
remove some code that is especially large.
|
80
|
+
|
81
|
+
See [CMake's documentation](https://cmake.org/cmake/help/v3.4/manual/cmake-variables.7.html)
|
82
|
+
for other variables which may be used to configure the build.
|
83
|
+
|
84
|
+
### Building for Android
|
85
|
+
|
86
|
+
It's possible to build BoringSSL with the Android NDK using CMake. Recent
|
87
|
+
versions of the NDK include a CMake toolchain file which works with CMake 3.6.0
|
88
|
+
or later. This has been tested with version r16b of the NDK.
|
89
|
+
|
90
|
+
Unpack the Android NDK somewhere and export `ANDROID_NDK` to point to the
|
91
|
+
directory. Then run CMake like this:
|
92
|
+
|
93
|
+
cmake -DANDROID_ABI=armeabi-v7a \
|
94
|
+
-DANDROID_PLATFORM=android-19 \
|
95
|
+
-DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK}/build/cmake/android.toolchain.cmake \
|
96
|
+
-GNinja -B build
|
97
|
+
|
98
|
+
Once you've run that, Ninja should produce Android-compatible binaries. You
|
99
|
+
can replace `armeabi-v7a` in the above with `arm64-v8a` and use API level 21 or
|
100
|
+
higher to build aarch64 binaries.
|
101
|
+
|
102
|
+
For other options, see the documentation in the toolchain file.
|
103
|
+
|
104
|
+
To debug the resulting binaries on an Android device with `gdb`, run the
|
105
|
+
commands below. Replace `ARCH` with the architecture of the target device, e.g.
|
106
|
+
`arm` or `arm64`.
|
107
|
+
|
108
|
+
adb push ${ANDROID_NDK}/prebuilt/android-ARCH/gdbserver/gdbserver \
|
109
|
+
/data/local/tmp
|
110
|
+
adb forward tcp:5039 tcp:5039
|
111
|
+
adb shell /data/local/tmp/gdbserver :5039 /path/on/device/to/binary
|
112
|
+
|
113
|
+
Then run the following in a separate shell. Replace `HOST` with the OS and
|
114
|
+
architecture of the host machine, e.g. `linux-x86_64`.
|
115
|
+
|
116
|
+
${ANDROID_NDK}/prebuilt/HOST/bin/gdb
|
117
|
+
target remote :5039 # in gdb
|
118
|
+
|
119
|
+
### Building for iOS
|
120
|
+
|
121
|
+
To build for iOS, pass `-DCMAKE_OSX_SYSROOT=iphoneos` and
|
122
|
+
`-DCMAKE_OSX_ARCHITECTURES=ARCH` to CMake, where `ARCH` is the desired
|
123
|
+
architecture, matching values used in the `-arch` flag in Apple's toolchain.
|
124
|
+
|
125
|
+
Passing multiple architectures for a multiple-architecture build is not
|
126
|
+
supported.
|
127
|
+
|
128
|
+
### Building with Prefixed Symbols
|
129
|
+
|
130
|
+
BoringSSL's build system has experimental support for adding a custom prefix to
|
131
|
+
all symbols. This can be useful when linking multiple versions of BoringSSL in
|
132
|
+
the same project to avoid symbol conflicts.
|
133
|
+
|
134
|
+
In order to build with prefixed symbols, the `BORINGSSL_PREFIX` CMake variable
|
135
|
+
should specify the prefix to add to all symbols, and the
|
136
|
+
`BORINGSSL_PREFIX_SYMBOLS` CMake variable should specify the path to a file
|
137
|
+
which contains a list of symbols which should be prefixed (one per line;
|
138
|
+
comments are supported with `#`). In other words, `cmake -B build
|
139
|
+
-DBORINGSSL_PREFIX=MY_CUSTOM_PREFIX
|
140
|
+
-DBORINGSSL_PREFIX_SYMBOLS=/path/to/symbols.txt` will configure the build to add
|
141
|
+
the prefix `MY_CUSTOM_PREFIX` to all of the symbols listed in
|
142
|
+
`/path/to/symbols.txt`.
|
143
|
+
|
144
|
+
It is currently the caller's responsibility to create and maintain the list of
|
145
|
+
symbols to be prefixed. Alternatively, `util/read_symbols.go` reads the list of
|
146
|
+
exported symbols from a `.a` file, and can be used in a build script to generate
|
147
|
+
the symbol list on the fly (by building without prefixing, using
|
148
|
+
`read_symbols.go` to construct a symbol list, and then building again with
|
149
|
+
prefixing).
|
150
|
+
|
151
|
+
This mechanism is under development and may change over time. Please contact the
|
152
|
+
BoringSSL maintainers if making use of it.
|
153
|
+
|
154
|
+
## Known Limitations on Windows
|
155
|
+
|
156
|
+
* CMake can generate Visual Studio projects, but the generated project files
|
157
|
+
don't have steps for assembling the assembly language source files, so they
|
158
|
+
currently cannot be used to build BoringSSL.
|
159
|
+
|
160
|
+
## ARM CPU Capabilities
|
161
|
+
|
162
|
+
ARM, unlike Intel, does not have a userspace instruction that allows
|
163
|
+
applications to discover the capabilities of the processor. Instead, the
|
164
|
+
capability information has to be provided by a combination of compile-time
|
165
|
+
information and the operating system.
|
166
|
+
|
167
|
+
BoringSSL determines capabilities at compile-time based on `__ARM_NEON`,
|
168
|
+
`__ARM_FEATURE_AES`, and other preprocessor symbols defined in
|
169
|
+
[Arm C Language Extensions (ACLE)](https://developer.arm.com/architectures/system-architectures/software-standards/acle).
|
170
|
+
These values are usually controlled by the `-march` flag. You can also define
|
171
|
+
any of the following to enable the corresponding ARM feature, but using the ACLE
|
172
|
+
symbols via `-march` is recommended.
|
173
|
+
|
174
|
+
* `OPENSSL_STATIC_ARMCAP_NEON`
|
175
|
+
* `OPENSSL_STATIC_ARMCAP_AES`
|
176
|
+
* `OPENSSL_STATIC_ARMCAP_SHA1`
|
177
|
+
* `OPENSSL_STATIC_ARMCAP_SHA256`
|
178
|
+
* `OPENSSL_STATIC_ARMCAP_PMULL`
|
179
|
+
|
180
|
+
The resulting binary will assume all such features are always present. This can
|
181
|
+
reduce code size, by allowing the compiler to omit fallbacks. However, if the
|
182
|
+
feature is not actually supported at runtime, BoringSSL will likely crash.
|
183
|
+
|
184
|
+
BoringSSL will additionally query the operating system at runtime for additional
|
185
|
+
features, e.g. with `getauxval` on Linux. This allows a single binary to use
|
186
|
+
newer instructions when present, but still function on CPUs without them. But
|
187
|
+
some environments don't support runtime queries. If building for those, define
|
188
|
+
`OPENSSL_STATIC_ARMCAP` to limit BoringSSL to compile-time capabilities. If not
|
189
|
+
defined, the target operating system must be known to BoringSSL.
|
190
|
+
|
191
|
+
## Binary Size
|
192
|
+
|
193
|
+
The implementations of some algorithms require a trade-off between binary size
|
194
|
+
and performance. For instance, BoringSSL's fastest P-256 implementation uses a
|
195
|
+
148 KiB pre-computed table. To optimize instead for binary size, pass
|
196
|
+
`-DOPENSSL_SMALL=1` to CMake or define the `OPENSSL_SMALL` preprocessor symbol.
|
197
|
+
|
198
|
+
# Running Tests
|
199
|
+
|
200
|
+
There are two sets of tests: the C/C++ tests and the blackbox tests. For former
|
201
|
+
are built by Ninja and can be run from the top-level directory with `go run
|
202
|
+
util/all_tests.go`. The latter have to be run separately by running `go test`
|
203
|
+
from within `ssl/test/runner`.
|
204
|
+
|
205
|
+
Both sets of tests may also be run with `ninja -C build run_tests`, but CMake
|
206
|
+
3.2 or later is required to avoid Ninja's output buffering.
|
@@ -21,7 +21,7 @@ endif()
|
|
21
21
|
|
22
22
|
project(
|
23
23
|
couchbase_cxx_client
|
24
|
-
VERSION "1.0.
|
24
|
+
VERSION "1.0.4"
|
25
25
|
LANGUAGES CXX C)
|
26
26
|
message(STATUS "Couchbase C++ client ${couchbase_cxx_client_VERSION} build ${couchbase_cxx_client_BUILD_NUMBER}, master: ${COUCHBASE_CXX_CLIENT_MASTER_PROJECT}")
|
27
27
|
message(STATUS "System: ${CMAKE_SYSTEM_NAME}, ${CMAKE_SYSTEM_VERSION}, ${CMAKE_SYSTEM_PROCESSOR}")
|
@@ -76,18 +76,7 @@ include(cmake/OpenSSL.cmake)
|
|
76
76
|
|
77
77
|
include(cmake/VersionInfo.cmake)
|
78
78
|
|
79
|
-
include(cmake/
|
80
|
-
couchbase_cxx_check_filesystem(
|
81
|
-
couchbase_cxx_client
|
82
|
-
"filesystem"
|
83
|
-
"std::filesystem"
|
84
|
-
"stdc++fs;c++fs"
|
85
|
-
STD_FILESYSTEM)
|
86
|
-
if(STD_FILESYSTEM)
|
87
|
-
message(STATUS "Using std::filesystem")
|
88
|
-
else()
|
89
|
-
message(FATAL_ERROR "Couchbase C++ Client requires C++17, including an implementation of std::filesystem.")
|
90
|
-
endif()
|
79
|
+
include(cmake/RPath.cmake)
|
91
80
|
|
92
81
|
add_subdirectory(core/platform)
|
93
82
|
set(couchbase_cxx_client_FILES
|
@@ -242,6 +231,7 @@ set(couchbase_cxx_client_FILES
|
|
242
231
|
core/io/mcbp_message.cxx
|
243
232
|
core/io/mcbp_parser.cxx
|
244
233
|
core/io/mcbp_session.cxx
|
234
|
+
core/io/streams.cxx
|
245
235
|
core/key_value_config.cxx
|
246
236
|
core/logger/custom_rotating_file_sink.cxx
|
247
237
|
core/logger/logger.cxx
|
@@ -260,6 +250,7 @@ set(couchbase_cxx_client_FILES
|
|
260
250
|
core/mcbp/server_duration.cxx
|
261
251
|
core/meta/version.cxx
|
262
252
|
core/metrics/logging_meter.cxx
|
253
|
+
core/metrics/meter_wrapper.cxx
|
263
254
|
core/n1ql_query_options.cxx
|
264
255
|
core/operations/document_analytics.cxx
|
265
256
|
core/operations/document_append.cxx
|
@@ -412,6 +403,7 @@ set(couchbase_cxx_client_FILES
|
|
412
403
|
core/seed_config.cxx
|
413
404
|
core/topology/configuration.cxx
|
414
405
|
core/tracing/threshold_logging_tracer.cxx
|
406
|
+
core/tracing/tracer_wrapper.cxx
|
415
407
|
core/transactions/active_transaction_record.cxx
|
416
408
|
core/transactions/async_attempt_context.cxx
|
417
409
|
core/transactions/atr_cleanup_entry.cxx
|
@@ -492,6 +484,19 @@ if(WIN32 OR NOT COUCHBASE_CXX_CLIENT_BUILD_SHARED)
|
|
492
484
|
endif()
|
493
485
|
|
494
486
|
foreach(TARGET ${couchbase_cxx_client_LIBRARIES})
|
487
|
+
include(cmake/DetectStandardFilesystem.cmake)
|
488
|
+
couchbase_cxx_check_filesystem(
|
489
|
+
${TARGET}
|
490
|
+
"filesystem"
|
491
|
+
"std::filesystem"
|
492
|
+
"stdc++fs;c++fs"
|
493
|
+
STD_FILESYSTEM)
|
494
|
+
if(STD_FILESYSTEM)
|
495
|
+
message(STATUS "Using std::filesystem")
|
496
|
+
else()
|
497
|
+
message(FATAL_ERROR "Couchbase C++ Client requires C++17, including an implementation of std::filesystem.")
|
498
|
+
endif()
|
499
|
+
|
495
500
|
set_target_properties(${TARGET} PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
496
501
|
|
497
502
|
target_include_directories(
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# Contributor: Couchbase SDK Team <support@couchbase.com>
|
2
|
+
# Maintainer: Couchbase SDK Team <support@couchbase.com>
|
3
|
+
|
4
|
+
pkgname=couchbase-cxx-client
|
5
|
+
pkgver=@COUCHBASE_CXX_CLIENT_PACKAGE_VERSION@
|
6
|
+
pkgrel=1
|
7
|
+
_number_of_commits=@COUCHBASE_CXX_CLIENT_NUMBER_OF_COMMITS@
|
8
|
+
if [ "${_number_of_commits}" -gt 0 ]; then
|
9
|
+
pkgver="${pkgver}_p${_number_of_commits}"
|
10
|
+
fi
|
11
|
+
source="${pkgname}-${pkgver}.tar.gz"
|
12
|
+
pkgdesc="Couchbase C++ SDK"
|
13
|
+
url="https://docs.couchbase.com/cxx-sdk/current/hello-world/overview.html"
|
14
|
+
arch="all"
|
15
|
+
license="Apache-2.0"
|
16
|
+
depends=""
|
17
|
+
makedepends="
|
18
|
+
linux-headers
|
19
|
+
cmake
|
20
|
+
ninja
|
21
|
+
"
|
22
|
+
subpackages="${pkgname}-dev ${pkgname}-tools"
|
23
|
+
options="!check"
|
24
|
+
|
25
|
+
unpack() {
|
26
|
+
(cd "${srcdir}"; tar -xzf "${source}" --strip-components=1)
|
27
|
+
}
|
28
|
+
|
29
|
+
build() {
|
30
|
+
cmake -B apk-build -S "${srcdir}" -G Ninja \
|
31
|
+
-DCMAKE_INSTALL_PREFIX=/usr \
|
32
|
+
-DCMAKE_BUILD_TYPE=MinSizeRel \
|
33
|
+
-DBUILD_SHARED_LIBS=OFF \
|
34
|
+
-DCOUCHBASE_CXX_CLIENT_PKGCONFIG_VERSION="${pkgver}" \
|
35
|
+
-DCOUCHBASE_CXX_CLIENT_INSTALL=ON \
|
36
|
+
-DCOUCHBASE_CXX_CLIENT_STATIC_BORINGSSL=ON \
|
37
|
+
-DCOUCHBASE_CXX_CLIENT_BUILD_EXAMPLES=OFF \
|
38
|
+
-DCOUCHBASE_CXX_CLIENT_BUILD_TESTS=OFF \
|
39
|
+
-DCOUCHBASE_CXX_CLIENT_BUILD_TOOLS=ON \
|
40
|
+
-DCOUCHBASE_CXX_CLIENT_BUILD_STATIC=OFF \
|
41
|
+
-DCOUCHBASE_CXX_CLIENT_BUILD_SHARED=ON
|
42
|
+
cmake --build apk-build
|
43
|
+
}
|
44
|
+
|
45
|
+
tools() {
|
46
|
+
pkgdesc="${pkgdesc} (tools)"
|
47
|
+
depends="${pkgname}=${pkgver}-r${pkgrel}"
|
48
|
+
|
49
|
+
amove usr/bin
|
50
|
+
}
|
51
|
+
|
52
|
+
package() {
|
53
|
+
DESTDIR="${pkgdir}" cmake --install apk-build
|
54
|
+
}
|
@@ -70,11 +70,6 @@ function(set_project_warnings project_name)
|
|
70
70
|
)
|
71
71
|
|
72
72
|
set(CLANG_WARNINGS ${COMMON_WARNINGS})
|
73
|
-
if(CMAKE_CXX_COMPILER_ID MATCHES ".*Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS_EQUAL "17.0.0")
|
74
|
-
set(CLANG_WARNINGS ${CLANG_WARNINGS} -Wshadow # warn the user if a variable declaration shadows one from a parent
|
75
|
-
# context
|
76
|
-
)
|
77
|
-
endif()
|
78
73
|
|
79
74
|
if(MSVC)
|
80
75
|
set(PROJECT_WARNINGS ${MSVC_WARNINGS})
|