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

Bump nodejs #6973

Closed
wants to merge 3 commits into from
Closed

Bump nodejs #6973

wants to merge 3 commits into from

Conversation

suhan-paradkar
Copy link
Contributor

Update nodejs to latest version... had to update the patches too..

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep the patch split on multiple files.

@suhan-paradkar
Copy link
Contributor Author

@xeffyr.. It gives bad register name errors for i686.... and those register errors are specific to ia32(saw it at stackoverflow.. ofcourse)...
Does it mean thaat nodejs now has to be disabled for i686??

@ghost
Copy link

ghost commented Jun 8, 2021

I have disabled it for i686, but let's enable build for x86_64 to see how its status changes by comparing to previous version.

In general, it is preferred to keep popular packages on outdated version rather than disabling for specific arches due to error. Disabling i686 nodejs will most likely lead to complaints from Chromebook owners who use Termux as development environment.

@suhan-paradkar
Copy link
Contributor Author

I guess chromebook users will have to revert back to nodejs-lts then.....

@suhan-paradkar
Copy link
Contributor Author

Closing as these assembly errors are persistent for arm cpus also....

@Leif-W
Copy link

Leif-W commented Jun 15, 2021

Hello. I came to termux-packages to see if nodejs could be bumped and found this recently closed issue.

I do not understand the reason. @suhan-paradkar can you provide the link to StackOverflow for the issue referenced above? Bad register name errors for i686 specific to ia32?

What is the cause of the errors? What was done to try to fix this? Can something else be tried to fix this? Has this type of error ever occurred on any other package? If yes, how was that resolved?

Is this possible to update on-device with clang? The nodejs build docs specifically mention gcc as a requirement. Is this an actual requirement? Or is it just an assumed/normative/de-facto standard? Does gcc generate compatible assembly in this case? Or is clang known for a fact to be compatible?

I don't care either way, I'm just trying to understand the situation, but using clang would possibly be easier and less error prone if building on device, as gcc apparently is no longer fully supported on Android.

@suhan-paradkar suhan-paradkar deleted the node branch June 15, 2021 11:30
@suhan-paradkar
Copy link
Contributor Author

@Leif-W

can you provide the link to StackOverflow for the issue referenced above? Bad register name errors for i686 specific to ia32?

Here's one example....
https://stackoverflow.com/questions/33193551/x86-ia32-assembly-bad-register-name

Also... note that there are several other bad registers encountered while compiling....
You can see those in the github action check logs of the above commits....

Is this possible to update on-device with clang?

I guess that would be possible... but would take a lot of resources... even github actions CI runs out of memory sometimes while building nodejs

The nodejs build docs specifically mention gcc as a requirement. Is this an actual requirement? Or is it just an assumed/normative/de-facto standard?

That is a requirement of most packages but aince gcc is unsupported, we use clang...

Does gcc generate compatible assembly in this case? Or is clang known for a fact to be compatible?

About compatibility with gcc in termux...I don't think anyone haas tried it yet....
clang has helped us create so many packages... of course..with its own problems tho

but using clang would possibly be easier and less error prone

that is true since we are cross compiling...
I hapo you have got the answers you've been looking for...

@suhan-paradkar suhan-paradkar restored the node branch June 15, 2021 12:37
@Leif-W
Copy link

Leif-W commented Jun 16, 2021

Thank you for the explanations!

I guess that would be possible... but would take a lot of resources... even github actions CI runs out of memory sometimes while building nodejs

How much memory does the CI have when it runs out? And how much disk space is required? My new phone has almost as good specs as my 10-yr old PC, so... :) There is one way to find out, I guess.

that is true since we are cross compiling...
I hapo you have got the answers you've been looking for...

Some answers, and more questions, but thanks for the SO example, now I know where to begin looking.

@sayantan300
Copy link

I was just searching around the stackoverflow, so I'm wondering whether is this of any help?
https://stackoverflow.com/a/11841965/13712189

@sayantan300
Copy link

Also I'm wondering, I checked my arm info via this command: cat /proc/cpuinfo | more and it showed arm7l,
So can I use this tar file and unzip it to run nodejs v16?
https://nodejs.org/dist/v16.6.2/node-v16.6.2-linux-armv7l.tar.gz

@ghost
Copy link

ghost commented Aug 13, 2021

https://wiki.termux.com/wiki/Differences_from_Linux

Even if you manage to run it, there no guarantee that it will work properly. Termux is not standard Linux distribution, that's a custom userspace for Android.

However it should work under proot.

@Leif-W
Copy link

Leif-W commented Aug 13, 2021

@sayantan300 Regarding the file, 'Linux' == 'Android' but ! 'Linux' === 'Android'. Yes, the same core OS source code, but vast differences in file locations, SELinux, tool chains, encironment, etc. Besides, why ask when you can try it and see? I tried with the Arm64 aka v8 aka Aarch build, and it immediately exits with a file not found error.

@sayantan300
Copy link

Eh

@sayantan300
Copy link

I'm noob when it comes to those parts

@sayantan300
Copy link

@xeffyr so you're sure I can use nodejs 16 with proot? Lemme try it out and hope it doesn't fills up my storage

@ghost
Copy link

ghost commented Aug 13, 2021

Yes, you should be able to use it under proot. I haven't tried it, but if that's a static binary (and linked with Musl libc, not GNU), termux-chroot from package proot should be sufficient. Also you may need resolv-conf package installed.

In case if it was linked with GNU libc (no matter statically or not), you will need at least basic installation of Ubuntu or Debian under proot. That's needed because GNU libc splits DNS resolver into separate component often distributed as shared library only.

Try it and see whether it worked or not. Suggesting to try npm with it as well.

@ghost
Copy link

ghost commented Aug 13, 2021

I have checked it myself - it won't work in Termux directly even with termux-chroot. You need to setup Ubuntu chroot, e. g. with proot-distro install ubuntu-20.04 and use node inside this system.

Screenshot_20210813-160748

@sayantan300
Copy link

@xeffyr noice! We can actually run nodejs v16 somehow then!
Maybe you can make docs on how to upgrade nodejs to v16 then 😄

I shall be sharing this with everyone for now!

@sayantan300
Copy link

Actually wondering how can I contribute to termux docs so I can add there how to upgrade to nodejs v16 like how you did...

@ghost
Copy link

ghost commented Aug 13, 2021

Actually this isn't upgrading the Termux Node.js but custom installation inside chroot. Termux docs are only about Termux and things officially packaged.

@sayantan300
Copy link

sayantan300 commented Aug 13, 2021

Oh sorry, but maybe we everyone know about this though

@Leif-W
Copy link

Leif-W commented Aug 13, 2021

Also confirmed using proot-distro with ubuntu-21.04, at least node -v ran. Hadn't played with, or realized what proot allowed. Learned something new, thanks for the tips.

This is almost like a Linux/Android/Termux System for Linux inside Termux inside Android inside Linux (on a phone). If I tried this level of nesting on my desktop, it would struggle. Phone seems to handle it ok.

@ghost
Copy link

ghost commented Aug 13, 2021

If I tried this level of nesting on my desktop, it would struggle.

This isn't nesting. The only overhead there is proot, everything else is just userspace switch (export PATH=/path/to/dir) and binaries are executed by Linux directly and not by Android. On desktop system the closest approach would be Docker, even though it works differently from proot.

@sayantan300
Copy link

Yay I finally installed it on my mobile!
Btw, the distros of proot are a lot bigger than the anlinux ones, so I found that proot-distros also have some problem with sudo stuff and it installs some packages from start too, making it 2x times larger. Maybe you can remove those useless stuff like neofetch etc, and let users install it themselves?

@suhan-paradkar
Copy link
Contributor Author

Currently about nodejs16... Its stuck at v8.. which is a depenency and is causing the assembly errors...

@Leif-W
Copy link

Leif-W commented Aug 15, 2021

@suhan-paradkar Is it something that was fixed upstream? Obviously, Node.js and V8 engine have been compiled successfully on ARMv7 and ARMv8, because it runs just fine on ARMv7 and ARMv8 using proot as demonstrated here.

@suhan-paradkar
Copy link
Contributor Author

@Leif-W
Well.. further digging into the issue showed that the issue is with the incorrect identification of cpu arch by the bundled v8 in nodejs...
Thats why currently work is in progress in compiling v8 into termux after which we may bump nodejs using prebuilt v8

@Yonle
Copy link
Contributor

Yonle commented Aug 15, 2021

@suhan-paradkar Is it something that was fixed upstream? Obviously, Node.js and V8 engine have been compiled successfully on ARMv7 and ARMv8, because it runs just fine on ARMv7 and ARMv8 using proot as demonstrated here.

Please know the Differences from Linux.

@thunder-coding
Copy link
Member

About a seperate V8 package, the progress can be seen in #7290

@Leif-W
Copy link

Leif-W commented Aug 15, 2021

@Yonle

Please know the Differences from Linux.

I know the differences. I've used Linux 25+ years. V8 compiles and runs on ARM, so it's not a problem with code or assembly or registers. It is a problem with paths, tools, detection, configuration.

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

Successfully merging this pull request may close these issues.

5 participants