uhop / node-re2

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

Fix build on alpine-arm64, actually resolves #180 #195

Closed zotanmew closed 8 months ago

zotanmew commented 8 months ago

I'd highly recommend releasing this as soon as possible, this is breaking arm64 docker images, presumably not just for me :)

zotanmew commented 8 months ago

The failing CI checks are strange. I just ran exactly the same actions on my branch and they all passed o.O (ref: https://github.com/zotanmew/node-re2/actions/runs/6757292988/)

uhop commented 8 months ago

Don't despair — sometimes (well, frequently) Github CI fails for no discernable reasons. I'll re-run the test.

uhop commented 8 months ago

Hmm, nope, it is reproducible. Apparently, a MacOS runner for Node 21 has no distutils.

uhop commented 8 months ago

Welcome to the beautiful world of Node extensions, where I spent 99% of my time wrangling setup files instead of coding.

gyp info find Python using Python version 3.12.0 found at "/usr/local/bin/python3"

From https://docs.python.org/3/whatsnew/3.12.html

Python 3.12 is the latest stable release of the Python programming language, with a mix of changes to the language and the standard library. The library changes focus on cleaning up deprecated APIs, usability, and correctness. Of note, the distutils package has been removed from the standard library.

Obviously, I don't use distutils but apparently the dependencies (gyp?) do. The whole system is very brittle and that's why I was heartbroken when the maintainers of google/re2 decided to use absail for no apparent reason increasing the dependencies and greatly expanding the surface of "what can/will go wrong".

I suggest waiting for node-gyp or gyp to fix it — it is not like my code broke it. The change has broken all Node extensions.

PS: I kinda thinking of creating a project based on Node-API or even WASM to avoid the dependency compatibility hell. Not sure it'll help. :-(

PPS: I hope now people understand why supporting more architectures is not trivial.

zotanmew commented 8 months ago

Very strange. It runs successfully on my branch 🥴 https://github.com/zotanmew/node-re2/actions/runs/6757292988

uhop commented 8 months ago

It still fails, but worked for me in a separate brunch. Merging...

viceice commented 8 months ago

Welcome to the beautiful world of Node extensions, where I spent 99% of my time wrangling setup files instead of coding.

gyp info find Python using Python version 3.12.0 found at "/usr/local/bin/python3"

From https://docs.python.org/3/whatsnew/3.12.html

Python 3.12 is the latest stable release of the Python programming language, with a mix of changes to the language and the standard library. The library changes focus on cleaning up deprecated APIs, usability, and correctness. Of note, the distutils package has been removed from the standard library.

Obviously, I don't use distutils but apparently the dependencies (gyp?) do. The whole system is very brittle and that's why I was heartbroken when the maintainers of google/re2 decided to use absail for no apparent reason increasing the dependencies and greatly expanding the surface of "what can/will go wrong".

I suggest waiting for node-gyp or gyp to fix it — it is not like my code broke it. The change has broken all Node extensions.

PS: I kinda thinking of creating a project based on Node-API or even WASM to avoid the dependency compatibility hell. Not sure it'll help. :-(

PPS: I hope now people understand why supporting more architectures is not trivial.

a wasm version would be great, you would only need one build for different node versions and architectures. ❤️