couchbase 4.4.3 → 4.4.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (166) hide show
  1. package/BUILDING.md +182 -0
  2. package/CMakeLists.txt +11 -0
  3. package/CONTRIBUTING.md +1 -1
  4. package/README.md +4 -2
  5. package/deps/couchbase-cxx-cache/boringssl/e31ea00c1ea52052d2d78d44006cc88c80fa24a9/boringssl/src/BUILDING.md +206 -0
  6. package/deps/couchbase-cxx-client/CMakeLists.txt +3 -1
  7. package/deps/couchbase-cxx-client/README.md +2 -2
  8. package/deps/couchbase-cxx-client/cmake/APKBUILD.in +54 -0
  9. package/deps/couchbase-cxx-client/cmake/CompilerWarnings.cmake +0 -5
  10. package/deps/couchbase-cxx-client/cmake/Packaging.cmake +174 -11
  11. package/deps/couchbase-cxx-client/cmake/RPath.cmake +10 -0
  12. package/deps/couchbase-cxx-client/cmake/VersionInfo.cmake +4 -0
  13. package/deps/couchbase-cxx-client/cmake/build_version.hxx.in +1 -0
  14. package/deps/couchbase-cxx-client/cmake/couchbase-cxx-client.spec.in +2 -2
  15. package/deps/couchbase-cxx-client/cmake/couchbase_cxx_client.pc.in +2 -2
  16. package/deps/couchbase-cxx-client/cmake/debian/changelog.in +5 -0
  17. package/deps/couchbase-cxx-client/cmake/debian/compat +1 -0
  18. package/deps/couchbase-cxx-client/cmake/debian/control +40 -0
  19. package/deps/couchbase-cxx-client/cmake/debian/rules +41 -0
  20. package/deps/couchbase-cxx-client/cmake/debian/source/format +1 -0
  21. package/deps/couchbase-cxx-client/core/impl/analytics.cxx +1 -0
  22. package/deps/couchbase-cxx-client/core/impl/collection.cxx +27 -3
  23. package/deps/couchbase-cxx-client/core/impl/error.cxx +24 -3
  24. package/deps/couchbase-cxx-client/core/impl/get_replica.hxx +2 -0
  25. package/deps/couchbase-cxx-client/core/impl/lookup_in_replica.hxx +2 -0
  26. package/deps/couchbase-cxx-client/core/impl/observe_seqno.hxx +2 -0
  27. package/deps/couchbase-cxx-client/core/impl/query.cxx +1 -0
  28. package/deps/couchbase-cxx-client/core/impl/search.cxx +2 -0
  29. package/deps/couchbase-cxx-client/core/io/http_command.hxx +2 -2
  30. package/deps/couchbase-cxx-client/core/io/mcbp_command.hxx +1 -1
  31. package/deps/couchbase-cxx-client/core/meta/features.hxx +11 -0
  32. package/deps/couchbase-cxx-client/core/meta/version.cxx +47 -6
  33. package/deps/couchbase-cxx-client/core/operations/document_analytics.cxx +23 -17
  34. package/deps/couchbase-cxx-client/core/operations/document_analytics.hxx +1 -0
  35. package/deps/couchbase-cxx-client/core/operations/document_append.hxx +2 -0
  36. package/deps/couchbase-cxx-client/core/operations/document_decrement.hxx +2 -0
  37. package/deps/couchbase-cxx-client/core/operations/document_exists.hxx +2 -0
  38. package/deps/couchbase-cxx-client/core/operations/document_get.hxx +2 -0
  39. package/deps/couchbase-cxx-client/core/operations/document_get_all_replicas.hxx +2 -0
  40. package/deps/couchbase-cxx-client/core/operations/document_get_and_lock.hxx +2 -0
  41. package/deps/couchbase-cxx-client/core/operations/document_get_and_touch.hxx +2 -0
  42. package/deps/couchbase-cxx-client/core/operations/document_get_any_replica.hxx +2 -0
  43. package/deps/couchbase-cxx-client/core/operations/document_get_projected.hxx +2 -0
  44. package/deps/couchbase-cxx-client/core/operations/document_increment.hxx +2 -0
  45. package/deps/couchbase-cxx-client/core/operations/document_insert.hxx +2 -0
  46. package/deps/couchbase-cxx-client/core/operations/document_lookup_in.hxx +2 -0
  47. package/deps/couchbase-cxx-client/core/operations/document_lookup_in_all_replicas.hxx +2 -0
  48. package/deps/couchbase-cxx-client/core/operations/document_lookup_in_any_replica.hxx +2 -0
  49. package/deps/couchbase-cxx-client/core/operations/document_mutate_in.hxx +2 -0
  50. package/deps/couchbase-cxx-client/core/operations/document_prepend.hxx +2 -0
  51. package/deps/couchbase-cxx-client/core/operations/document_query.hxx +1 -0
  52. package/deps/couchbase-cxx-client/core/operations/document_remove.hxx +2 -0
  53. package/deps/couchbase-cxx-client/core/operations/document_replace.hxx +2 -0
  54. package/deps/couchbase-cxx-client/core/operations/document_search.hxx +1 -0
  55. package/deps/couchbase-cxx-client/core/operations/document_touch.hxx +2 -0
  56. package/deps/couchbase-cxx-client/core/operations/document_unlock.hxx +2 -0
  57. package/deps/couchbase-cxx-client/core/operations/document_upsert.hxx +2 -0
  58. package/deps/couchbase-cxx-client/core/operations/document_view.hxx +1 -0
  59. package/deps/couchbase-cxx-client/core/operations/http_noop.hxx +2 -0
  60. package/deps/couchbase-cxx-client/core/operations/management/analytics_dataset_create.hxx +1 -0
  61. package/deps/couchbase-cxx-client/core/operations/management/analytics_dataset_drop.hxx +1 -0
  62. package/deps/couchbase-cxx-client/core/operations/management/analytics_dataset_get_all.hxx +1 -0
  63. package/deps/couchbase-cxx-client/core/operations/management/analytics_dataverse_create.hxx +1 -0
  64. package/deps/couchbase-cxx-client/core/operations/management/analytics_dataverse_drop.hxx +1 -0
  65. package/deps/couchbase-cxx-client/core/operations/management/analytics_get_pending_mutations.hxx +2 -0
  66. package/deps/couchbase-cxx-client/core/operations/management/analytics_index_create.hxx +1 -0
  67. package/deps/couchbase-cxx-client/core/operations/management/analytics_index_drop.hxx +1 -0
  68. package/deps/couchbase-cxx-client/core/operations/management/analytics_index_get_all.hxx +1 -0
  69. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_connect.hxx +1 -0
  70. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_create.hxx +1 -0
  71. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_disconnect.hxx +1 -0
  72. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_drop.hxx +1 -0
  73. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_get_all.cxx +23 -15
  74. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_get_all.hxx +4 -3
  75. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_replace.hxx +1 -0
  76. package/deps/couchbase-cxx-client/core/operations/management/bucket_create.hxx +1 -0
  77. package/deps/couchbase-cxx-client/core/operations/management/bucket_describe.hxx +1 -0
  78. package/deps/couchbase-cxx-client/core/operations/management/bucket_drop.hxx +1 -0
  79. package/deps/couchbase-cxx-client/core/operations/management/bucket_flush.hxx +1 -0
  80. package/deps/couchbase-cxx-client/core/operations/management/bucket_get.hxx +1 -0
  81. package/deps/couchbase-cxx-client/core/operations/management/bucket_get_all.hxx +1 -0
  82. package/deps/couchbase-cxx-client/core/operations/management/bucket_update.hxx +1 -0
  83. package/deps/couchbase-cxx-client/core/operations/management/change_password.hxx +1 -0
  84. package/deps/couchbase-cxx-client/core/operations/management/cluster_describe.hxx +1 -0
  85. package/deps/couchbase-cxx-client/core/operations/management/cluster_developer_preview_enable.hxx +1 -0
  86. package/deps/couchbase-cxx-client/core/operations/management/collection_create.hxx +2 -0
  87. package/deps/couchbase-cxx-client/core/operations/management/collection_drop.hxx +1 -0
  88. package/deps/couchbase-cxx-client/core/operations/management/collection_update.hxx +2 -0
  89. package/deps/couchbase-cxx-client/core/operations/management/collections_manifest_get.hxx +2 -0
  90. package/deps/couchbase-cxx-client/core/operations/management/eventing_deploy_function.hxx +3 -2
  91. package/deps/couchbase-cxx-client/core/operations/management/eventing_drop_function.hxx +3 -2
  92. package/deps/couchbase-cxx-client/core/operations/management/eventing_get_all_functions.hxx +3 -2
  93. package/deps/couchbase-cxx-client/core/operations/management/eventing_get_function.hxx +3 -2
  94. package/deps/couchbase-cxx-client/core/operations/management/eventing_get_status.hxx +3 -2
  95. package/deps/couchbase-cxx-client/core/operations/management/eventing_pause_function.hxx +3 -2
  96. package/deps/couchbase-cxx-client/core/operations/management/eventing_resume_function.hxx +3 -2
  97. package/deps/couchbase-cxx-client/core/operations/management/eventing_undeploy_function.hxx +3 -2
  98. package/deps/couchbase-cxx-client/core/operations/management/eventing_upsert_function.hxx +3 -2
  99. package/deps/couchbase-cxx-client/core/operations/management/freeform.hxx +2 -0
  100. package/deps/couchbase-cxx-client/core/operations/management/group_drop.hxx +1 -0
  101. package/deps/couchbase-cxx-client/core/operations/management/group_get.hxx +1 -0
  102. package/deps/couchbase-cxx-client/core/operations/management/group_get_all.hxx +1 -0
  103. package/deps/couchbase-cxx-client/core/operations/management/group_upsert.hxx +1 -0
  104. package/deps/couchbase-cxx-client/core/operations/management/query_index_build.hxx +2 -0
  105. package/deps/couchbase-cxx-client/core/operations/management/query_index_build_deferred.hxx +3 -0
  106. package/deps/couchbase-cxx-client/core/operations/management/query_index_create.hxx +1 -0
  107. package/deps/couchbase-cxx-client/core/operations/management/query_index_drop.hxx +1 -0
  108. package/deps/couchbase-cxx-client/core/operations/management/query_index_get_all.hxx +2 -0
  109. package/deps/couchbase-cxx-client/core/operations/management/query_index_get_all_deferred.hxx +3 -0
  110. package/deps/couchbase-cxx-client/core/operations/management/role_get_all.hxx +1 -0
  111. package/deps/couchbase-cxx-client/core/operations/management/scope_create.hxx +1 -0
  112. package/deps/couchbase-cxx-client/core/operations/management/scope_drop.hxx +1 -0
  113. package/deps/couchbase-cxx-client/core/operations/management/scope_get_all.hxx +1 -0
  114. package/deps/couchbase-cxx-client/core/operations/management/search_get_stats.hxx +1 -0
  115. package/deps/couchbase-cxx-client/core/operations/management/search_index_analyze_document.hxx +1 -0
  116. package/deps/couchbase-cxx-client/core/operations/management/search_index_control_ingest.hxx +1 -0
  117. package/deps/couchbase-cxx-client/core/operations/management/search_index_control_plan_freeze.hxx +1 -0
  118. package/deps/couchbase-cxx-client/core/operations/management/search_index_control_query.hxx +1 -0
  119. package/deps/couchbase-cxx-client/core/operations/management/search_index_drop.hxx +1 -0
  120. package/deps/couchbase-cxx-client/core/operations/management/search_index_get.hxx +1 -0
  121. package/deps/couchbase-cxx-client/core/operations/management/search_index_get_all.hxx +1 -0
  122. package/deps/couchbase-cxx-client/core/operations/management/search_index_get_documents_count.hxx +2 -0
  123. package/deps/couchbase-cxx-client/core/operations/management/search_index_get_stats.hxx +1 -0
  124. package/deps/couchbase-cxx-client/core/operations/management/search_index_upsert.hxx +1 -0
  125. package/deps/couchbase-cxx-client/core/operations/management/user_drop.hxx +1 -0
  126. package/deps/couchbase-cxx-client/core/operations/management/user_get.hxx +1 -0
  127. package/deps/couchbase-cxx-client/core/operations/management/user_get_all.hxx +1 -0
  128. package/deps/couchbase-cxx-client/core/operations/management/user_upsert.cxx +3 -3
  129. package/deps/couchbase-cxx-client/core/operations/management/user_upsert.hxx +1 -0
  130. package/deps/couchbase-cxx-client/core/operations/management/view_index_drop.hxx +1 -0
  131. package/deps/couchbase-cxx-client/core/operations/management/view_index_get.hxx +1 -0
  132. package/deps/couchbase-cxx-client/core/operations/management/view_index_get_all.hxx +2 -0
  133. package/deps/couchbase-cxx-client/core/operations/management/view_index_upsert.hxx +1 -0
  134. package/deps/couchbase-cxx-client/core/transactions/async_attempt_context.hxx +9 -21
  135. package/deps/couchbase-cxx-client/core/transactions/attempt_context.hxx +6 -33
  136. package/deps/couchbase-cxx-client/core/transactions/attempt_context_impl.cxx +41 -41
  137. package/deps/couchbase-cxx-client/core/transactions/attempt_context_impl.hxx +15 -16
  138. package/deps/couchbase-cxx-client/core/transactions/transaction_context.cxx +2 -2
  139. package/deps/couchbase-cxx-client/core/transactions/transaction_get_result.hxx +0 -20
  140. package/deps/couchbase-cxx-client/couchbase/common_options.hxx +16 -1
  141. package/deps/couchbase-cxx-client/couchbase/metrics/otel_meter.hxx +16 -20
  142. package/dist/analyticsindexmanager.d.ts +98 -14
  143. package/dist/analyticsindexmanager.js +452 -411
  144. package/dist/binding.d.ts +53 -4
  145. package/dist/bindingutilities.d.ts +26 -1
  146. package/dist/bindingutilities.js +108 -1
  147. package/dist/couchbase.d.ts +3 -1
  148. package/dist/couchbase.js +2 -0
  149. package/dist/rangeScan.d.ts +1 -1
  150. package/dist/rangeScan.js +1 -1
  151. package/dist/transactions.d.ts +34 -3
  152. package/dist/transactions.js +25 -18
  153. package/dist/transcoders.d.ts +68 -0
  154. package/dist/transcoders.js +194 -1
  155. package/dist/usermanager.d.ts +14 -14
  156. package/dist/usermanager.js +178 -228
  157. package/dist/utilities.js +4 -6
  158. package/dist/utilities_internal.js +1 -2
  159. package/package.json +9 -8
  160. package/src/connection.cpp +22 -0
  161. package/src/connection.hpp +12 -0
  162. package/src/connection_autogen.cpp +100 -0
  163. package/src/jstocbpp_autogen.hpp +315 -8
  164. package/src/jstocbpp_transactions.hpp +1 -2
  165. package/tools/gen-bindings-js.js +38 -3
  166. 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)
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://www.couchbase.com/issues/browse/JSCBC](https://www.couchbase.com/issues/browse/JSCBC)
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.3"
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,6 +76,8 @@ include(cmake/OpenSSL.cmake)
76
76
 
77
77
  include(cmake/VersionInfo.cmake)
78
78
 
79
+ include(cmake/RPath.cmake)
80
+
79
81
  add_subdirectory(core/platform)
80
82
  set(couchbase_cxx_client_FILES
81
83
  ${CMAKE_CURRENT_BINARY_DIR}/generated/mozilla_ca_bundle.cxx
@@ -21,9 +21,9 @@ CPMAddPackage(
21
21
  NAME
22
22
  couchbase_cxx_client
23
23
  GIT_TAG
24
- 1.0.3
24
+ 1.0.4
25
25
  VERSION
26
- 1.0.3
26
+ 1.0.4
27
27
  GITHUB_REPOSITORY
28
28
  "couchbase/couchbase-cxx-client"
29
29
  OPTIONS
@@ -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})