Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unix-dgram errors when building with Node 22 #278

Open
danielfigueiredo opened this issue Dec 12, 2024 · 2 comments
Open

unix-dgram errors when building with Node 22 #278

danielfigueiredo opened this issue Dec 12, 2024 · 2 comments

Comments

@danielfigueiredo
Copy link

Hey folks 👋 ,

I've updated to latest LTS Nodejs (22.X.X) stable release, and now I can't get rid of the V8 errors that comes from unix-dgram. The reason why I'm posting this here, is because hot-shots is the only reason why unix-dgram is in my dependency tree.

It is concerning to me that unix-dgram hasn't received a commit in 2 years and thus haven't made changes to support the new V8. Are there plans to migrate to another library or to patch unix-dgram?

Although these errors don't necessarily cause yarn to exit with code 1 and block installs or CI, they are very misleading and often make people waste time. An example log:

gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CXX(target) Release/obj.target/unix_dgram/src/unix_dgram.o
In file included from ../src/unix_dgram.cc:5:
../../nan/nan.h:2548:8: error: no matching member function for call to 'SetAccessor'
  tpl->SetAccessor(
  ~~~~~^~~~~~~~~~~
/Users/dfigueiredo/Library/Caches/node-gyp/22.11.0/include/node/v8-template.h:1055:8: note: candidate function not viable: no known conversion from 'v8::AccessControl' to 'PropertyAttribute' for 5th argument
  void SetAccessor(
       ^
/Users/dfigueiredo/Library/Caches/node-gyp/22.11.0/include/node/v8-template.h:1049:8: note: candidate function not viable: no known conversion from 'imp::NativeGetter' (aka 'void (*)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value> &)') to 'AccessorGetterCallback' (aka 'void (*)(Local<String>, const PropertyCallbackInfo<Value> &)') for 2nd argument
  void SetAccessor(
       ^
In file included from ../src/unix_dgram.cc:5:
../../nan/nan.h:2594:8: error: no matching member function for call to 'SetAccessor'
  tpl->SetAccessor(
  ~~~~~^~~~~~~~~~~
/Users/dfigueiredo/Library/Caches/node-gyp/22.11.0/include/node/v8-template.h:1055:8: note: candidate function not viable: no known conversion from 'v8::AccessControl' to 'PropertyAttribute' for 5th argument

To confirm hot-shots is the only library dependency on unix-dgram in our whole monorepo:

yarn why unix-dgram

[1/4] 🤔  Why do we have the module "unix-dgram"...?
[2/4] 🚚  Initialising dependency graph...
[3/4] 🔍  Finding dependency...
[4/4] 🚡  Calculating file sizes...
=> Found "[email protected]"
info Reasons this module exists
   - "_project_#@ourorg#backstage-plugin-pkgname-backend#@ourorg#pkgname#hot-shots" depends on it
   - Hoisted from "_project_#@ourorg#backstage-plugin-pkgname-backend#@ourorg#pkgname#hot-shots#unix-dgram"

(Just updated the org and pkgs names that cannot be disclosed)

Any insights here would be helpful and inform our roadmap 🙏 . The easiest for us would be to keep using hot-shots and this problem gets patched upstream, otherwise we wouldn't have many options other than ejecting and looking for an alternative.

Thanks all!

@bdeitte
Copy link
Collaborator

bdeitte commented Dec 14, 2024

Hi there, when I've looked in the past, I haven't found any libraries that implement unix-dgram. If anybody else knows of one that could work better, let me know. This has also been discussed in Node.js, since dgram support was removed at one point from Node.js, and it's been closed more than once as something that won't be redone there. nodejs/node#29339 "I'm the author of node-unix-dgram and its usage is light enough that I don't think unix_dgram is missed all that much."

So I believe the best action here is to open your concerns against unix-dgram, and I'd be happy to pull in a new version if something is fixed there.

@danielfigueiredo
Copy link
Author

Thanks @bdeitte !

I tried looking around, and I couldn't find anything, in fact I would expect this to be part of Nodejs as well 😞
But makes sense not to be there after reading the issue you linked

I've opened a similar issue on unix-dgram, let's see what they say!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants