You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During installation, Cbjs downloads a native binary that matches the machine running the install, based on its platform and architecture. This is fine when you install and run on the same platform.
9
+
10
+
It becomes a problem when you build on one platform and run on another. The usual case is bundling on CI and deploying to AWS Lambda, which runs on Linux/x64: the binary that ends up in the bundle is the one for your CI, not the one Lambda can load. If they are not both the same platform and architecture, you'll end up with an error.
11
+
12
+
## Selecting the binary
13
+
14
+
Set `COUCHBASE_BINARY_PLATFORM` to `linux` and `COUCHBASE_BINARY_ARCH` to the Lambda architecture when you install. Use `x64` for `x86_64` functions and `arm64` for Graviton functions. Both variables override the auto-detected value and have no effect when left unset.
You want `ELF 64-bit ... x86-64` for an `x86_64` function, or `ELF 64-bit ... ARM aarch64` for an `arm64` one. If you see `Mach-O`, the macOS binary leaked into the bundle.
41
+
42
+
::: warning
43
+
When no override is set, the install is skipped if a binary is already present. Setting `COUCHBASE_BINARY_PLATFORM` or `COUCHBASE_BINARY_ARCH` forces a fresh download, so a binary from a previous local install won't end up in a cross-platform bundle.
44
+
:::
45
+
46
+
## Pinning the version
47
+
48
+
`COUCHBASE_BINARY_VERSION` pins the version of the underlying Couchbase binary that is downloaded, regardless of platform and architecture.
0 commit comments