Skip to content

Bug: darwin-arm64 prebuilt lbugjs.node hardcodes Homebrew OpenSSL paths — dlopen fails on Macs without Homebrew (regression from 0.15.3) #681

Description

@alejandrodgb

Ladybug version

@ladybugdb/core 0.18.1 (npm prebuilt, darwin-arm64)

What operating system are you using?

macOS (Darwin 25.3.0, Apple Silicon), no Homebrew — OpenSSL via MacPorts

What happened?

Ladybug version

@ladybugdb/core 0.18.1 (npm prebuilt, darwin-arm64)

Operating system

macOS (Darwin 25.3.0, Apple Silicon) — without Homebrew (OpenSSL via MacPorts)

What happened?

The darwin-arm64 prebuilt lbugjs.node published to npm dynamically links OpenSSL at Homebrew's absolute install paths:

$ otool -L node_modules/@ladybugdb/core/lbugjs.node | grep ssl
	/opt/homebrew/opt/openssl@3/lib/libssl.3.dylib (compatibility version 3.0.0, current version 3.0.0)
	/opt/homebrew/opt/openssl@3/lib/libcrypto.3.dylib (compatibility version 3.0.0, current version 3.0.0)

On any Mac that doesn't have Homebrew installed (MacPorts users, or machines with no package manager at all), the native module fails to load:

dlopen(.../@ladybugdb/core/lbugjs.node, 0x0001): Library not loaded: /opt/homebrew/opt/openssl@3/lib/libssl.3.dylib
  Reason: tried: '/opt/homebrew/opt/openssl@3/lib/libssl.3.dylib' (no such file), ...

This is a regression: the 0.15.3 darwin-arm64 prebuilt was self-contained — it linked only system libraries (libSystem.B.dylib, libc++.1.dylib) with no OpenSSL dependency at all, and loaded fine on the same machine.

Expected: the npm prebuilt loads on a stock macOS install, without assuming Homebrew is present. Options that would achieve that: statically link OpenSSL into the prebuilt (as 0.15.3 effectively behaved), or bundle the dylibs and reference them via @rpath/@loader_path.

Downstream impact: any npm consumer of @ladybugdb/core is broken on Homebrew-less Macs (I hit this via gitnexus).

Workarounds I verified, for anyone else who lands here:

# Per-copy binary patch (no sudo):
install_name_tool \
  -change /opt/homebrew/opt/openssl@3/lib/libssl.3.dylib    /opt/local/lib/libssl.3.dylib \
  -change /opt/homebrew/opt/openssl@3/lib/libcrypto.3.dylib /opt/local/lib/libcrypto.3.dylib \
  path/to/lbugjs.node
codesign -f -s - path/to/lbugjs.node

# Or a system-wide shim (survives reinstalls):
sudo mkdir -p /opt/homebrew/opt/openssl@3/lib
sudo ln -s /opt/local/lib/libssl.3.dylib    /opt/homebrew/opt/openssl@3/lib/
sudo ln -s /opt/local/lib/libcrypto.3.dylib /opt/homebrew/opt/openssl@3/lib/

Are there known steps to reproduce?

On an Apple Silicon Mac without /opt/homebrew:

npm i @ladybugdb/core@0.18.1
node -e "require('@ladybugdb/core')"   # dlopen failure above
otool -L node_modules/@ladybugdb/core-darwin-arm64/lbugjs.node   # shows the hardcoded Homebrew paths

Installing @ladybugdb/core@0.15.3 on the same machine works (its lbugjs.node has no OpenSSL linkage).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions