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

OpenBSD bad node executable. #22629

Closed
sylkat opened this issue Aug 31, 2018 · 9 comments
Closed

OpenBSD bad node executable. #22629

sylkat opened this issue Aug 31, 2018 · 9 comments

Comments

@sylkat
Copy link

sylkat commented Aug 31, 2018

  • Version:8.11.4(LTS)
  • Platform:OpenBSD 6.3 GENERIC#100 amd64
  • Subsystem:lib/internal/bootstrap_node.js

The node executable generated by gmake gives this error:

bootstrap_node.js:78
      process.execPath = realpathSync.native(process.execPath);                                    
TypeError: realpathSync.native is not a function
    at startup (bootstrap_node.js:78:39)
    at bootstrap_node.js:612:3

The error is in bootstrap_node.js line 78:

// On OpenBSD process.execPath will be relative unless we
// get the full path before process.execPath is used.
   if (process.platform === 'openbsd') {
     const { realpathSync } = NativeModule.require('fs');
     **process.execPath = realpathSync.native(process.execPath);**
   }

This code is executed only for OpenBSD and commenting it will generate a correct node executable.
So the patch is comment those lines, maybe for older versions were need is not the case and the FS module seems that has not the native method anymore.

Regards,
Sylkat

@addaleax
Copy link
Member

addaleax commented Aug 31, 2018

This might have been caused by backporting #18543 to release branches where realpathSync.native is not available – what happens when you remove .native? I think that should work (and if it does, feel free to open a pull request with that against the v8.x-staging branch).

@sylkat
Copy link
Author

sylkat commented Aug 31, 2018

Yes just removing the .native is working.

@addaleax
Copy link
Member

@sylkat Okay, great – do you want to open a PR or should I?

@sylkat
Copy link
Author

sylkat commented Aug 31, 2018

Well really is the first time i am doing a pull in git and just now i am the guidelines for how to do it.
Sorry i didn't contribute to git, first time i do..so will take a little to do it, i guess i have to generate a patch and so..
Is ok if takes few hours?

@sylkat
Copy link
Author

sylkat commented Aug 31, 2018

Well i dont think is that complex i just generate the patch and post it with a little explanation.

@addaleax
Copy link
Member

@sylkat It’s perfectly fine for things to take a while, yes. And you’re right, the change itself is simple, so it’s perfectly fine if you’d prefer to not do it. If you need any help, feel free to ping me here or on IRC (https://webchat.freenode.net/?channels=node-dev&uio=d4).

(If you do post a patch, make sure to include the name/email address with which you want to be listed in the changelog somewhere.)

@sylkat
Copy link
Author

sylkat commented Aug 31, 2018

I posted the pull request:
#22632
If i have to edit it or you see something wrong feel free to tell me :)

@sylkat
Copy link
Author

sylkat commented Sep 2, 2018

I forked , commited the fix and pull request to merge from my fork to the v8.x-staging.
Hope this time is ok ;)

#22663

@apapirovski
Copy link
Member

This was fixed.

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

3 participants