uhop / node-re2

node.js bindings for RE2: fast, safe alternative to backtracking regular expression engines.
Other
479 stars 53 forks source link

Fails to import re2.node with when installing in node:20.9 arm alpine #196

Closed yaroslav-codefresh closed 8 months ago

yaroslav-codefresh commented 8 months ago

Steps to reproduce:

// run node:20 arm image on arm machine
docker run -it --entrypoint sh node:20.9.0-alpine3.18

// add required deps to build re2
apk add --no-cache .gyp \
    python3 \
    make \
    g++ \
    linux-headers

// install re2
yarn add re2

// run node
node

// try to import re2
> require('re2')

Output:

> require('re2')
Uncaught:
Error: Error relocating /node_modules/re2/build/Release/re2.node: _ZN4absl12lts_2023080218debugging_internal11VDSOSupportC1Ev: symbol not found
    at Module._extensions..node (node:internal/modules/cjs/loader:1327:18)
    at Module.load (node:internal/modules/cjs/loader:1091:32)
    at Module._load (node:internal/modules/cjs/loader:938:12)
    at Module.require (node:internal/modules/cjs/loader:1115:19)
    at require (node:internal/modules/helpers:130:18) {
  code: 'ERR_DLOPEN_FAILED'
}
yaroslav-codefresh commented 8 months ago

The same happens for node:18 arm image

yaroslav-codefresh commented 8 months ago

Would be grateful for help -- blocks updating our services to node 20

yaroslav-codefresh commented 8 months ago

@uhop any chance you can take a look?

uhop commented 8 months ago

I actually looked as soon as you filed it. It could be related to https://github.com/uhop/node-re2/pull/195

I don't have an ARM Linux machine to test it myself.

PRs are welcome!

uhop commented 8 months ago

I just published 1.20.7, which includes #195. See if it helps.

yaroslav-codefresh commented 8 months ago

@uhop great thx, checking

yaroslav-codefresh commented 8 months ago

@uhop huge thx, now it works fine. Closing the issue