-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
Node fails to start on MIPS32r2: "SyntaxError: Unexpected end of input" #3896
Comments
There should be a config.gypi in the top-level directory, configure creates it. Can you post its contents? |
I did also just try v5.1 - didn't compile at first because v8 apparently needs a patch:
(or else I get compiler errors about missing va_list definition etc.) But v5.1 fails with the same error on my OpenWRT board as v4.2.1 does (see first post). |
config.gypi looks alright to me. It gets baked into the binary and is then exposed as |
Well, I did as you said and added two console.log statements in there. Unfortunately now console.log fails....
Something appears to be terribly broken with node on MIPS. |
Does substituting it with |
I can try that.... recompiling takes > 30min though. Is there any way to get faster feedback (e.g. without recompiling node.js?) |
It should be an incremental build if you only touch src/node.js. Some files are regenerated but that's it. |
It appears for some reason my openwrt build root always recompiles everything.... will report back with findings of using process._rawDebug. Is there any sensible reason console.log shouldn't work already during node.js startup? I have the feeling that v8 may actually be broken and execute bogus code... |
node.js does some bootstrapping at startup. It's possible the process.config munging code runs too early for console.log to be working. |
Just a question: is it expected to have |
@targos I can't comment on this but maybe @bnoordhuis can? So here's the rebuild I've done with
Output:
So to me, it looks like the startup.processConfig is called twice, once with an empty (undefined?) input. Why that's the case I don't have a clue but looks like a bug to me. |
Scrap what I've said in the last paragraph. It seems output is only repeated twice, there's actually only one call to startup.processConfig. So it seems the string manipulation in there is somehow to blame.... |
@JohannesRudolph Are you cross-compiling? |
Out of curiosity, what is the literal contents of |
@bnoordhuis yes, I'm cross compiling from an x86_64 machine. Is there a way to override this byte order setting using a flag? In general using python from the host to get byte order would break all cross-compilation.... You'd have enough information from the |
@mscdex It actually doesn't matter, I get the same errror running just 'nodejs' without args. |
So I put the config from above directly into the code as a properly formatted object literal, and changed On to the next error:
At this point I believe nodejs on MIPS is just not ready for prime time. Does the node core team even test on MIPS targets? All of these errors are fairly blocking... |
There are no mips or mipsel machines in our CI matrix. The architecture is self-serve at the moment. |
@bnoordhuis it shows.... Can't even run the simplest code :-(
|
cc @jbergstroem did you ever get anywhere with that tessel 2? We should really aim to add those to the CI.. |
@Fishrock123 I have. It's up and running and I've been able to successfully build their firmware and upgrade it. The problem from our point of view is that running the test suite would take ages on it. My focus right now is to get better acquainted with their build system and look at what patches/build changes we can backport to make it easier for devs to integrate node on architectures like MIPS. I'm currently out of office, but I'll try to run a test run and see how long it'll actually take. |
👍 |
Is this still relevant? |
As far as I can see any underlying issues have not been fixed, so yes this
|
@JohannesRudolph can your device run debian/sid ? if so you might give a shot at the nodejs package there since version 4.4.x builds and ci tests pass on mips/mipsel. |
@kapouer What failure are you getting with v6 and mipsel? And where do you see it being a v8 issue? |
@wyze because of this build log. I reproduce on a different server with same CPU. I also tried some changes, like building without snapshot. When run with gdb, the stack trace is not useful, exactly as described here. Would a core dump be more useful in that case ? |
Thanks @kapouer. I was just curious as I am trying to build for OpenWRT and running into a build issue with v8 ( |
Closing, I'm reasonably sure this has been fixed now. (And if not - pull requests welcome!) |
I cross compiled nodejs for a MIPS32r2 (BE) target (without FPU but FPU emulation in the kernel) using the OpenWRT Chaos Calmer toolchain. The target CPU is an AR9331 but I suppose that's irrelevant.
I compile using
./configure --without-snapshot --without-npm --dest-cpu=mips --dest-os=linux
, so if I'm correct it should be compiled with hard float ABI.When I run node on the target, I get the following error however.
It's the same for 4.2.1 and 4.2.2. I'm not the only one getting this error, e.g. see http://techfindings.one/archives/2175
So to conclude this, nodejs is currently broken on MIPS. Any further info I can provide to you (since you're undoubtedly more qualified to fix this than I am)? How could I go about helping fix this?
If anyones interested in reproducing, here's the OpenWrt package I created for it.
The text was updated successfully, but these errors were encountered: