4commerce-technologies-AG / meteor

This is a fork of Meteor.js to support not yet official enabled architectures with an universal bundler. Meteor is an ultra-simple, database-everywhere, data-on-the-wire, pure-Javascript web framework. Read additional information about this fork at:
http://meteor-universal.tumblr.com/
Other
195 stars 16 forks source link

Installing meteor-universal on armv8 (64bit architecture) #42

Open Sing-Li opened 8 years ago

Sing-Li commented 8 years ago

Any tips for building meteor bundle for a Raspberry Pi 2 or 3 on a 64 bit system (Pine A64 ArchLinux)?

TIA

TomFreudenberg commented 8 years ago

Hi, what do you mean? This fork should / will run on a Raspi 2 and 3. Or do you want to run it on another architecture?

Please enter some more details

Sing-Li commented 8 years ago

On another architecture - Cortex A53 cores ... http://wiki.pine64.org/index.php/Main_Page

64 Bit Arch Linux is the only thing usable at this time on the Pine64 (https://www.pine64.com/) . I would like to cross-build on this platform, tar gz app bundles that will run on Raspi 2 and 3.

In other words, using the 64 bit Arch Linux platform on a Pine64, I need to be able to meteor build a tar gz bundle targeted for running on Rasp 2 or 3. Any pointers appreciated.

TA

TomFreudenberg commented 8 years ago

Hi @Sing-Li

nice device - haven't seen this before. Have you just tried to install the as described. I could pretty imagine that it just will run that device even on arch linux.

On the other hand, could you give me ssh access to that device? So I would come over an try to figure out what to do.

Cheers Tom

Sing-Li commented 8 years ago

Thanks @TomFreudenberg. ssh access is a great idea.

I am from the Rocket.Chat FOSS project https://github.com/RocketChat/Rocket.Chat (https://rocket.chat).

Thanks to your work, we're running Rocket.Chat now on a $5 Pi Zero :)

https://github.com/RocketChat/Rocket.Chat.RaspberryPi

Can you please come over to the 24 x 7 work + demo server (oauth using github is quick) and I can get you hooked up?

https://demo.rocket.chat/channel/raspberrypi

Alternatively, please email me at sing.li@rocket.chat

I already have the fork cloned and it is running. But during a meteor build it is failing not finding some binaries for aarch64.

Thanks again.

TomFreudenberg commented 8 years ago

Hi @Sing-Li - I am online in rocket.chat - I not sure if I have the time yet to run the complete process but just to enabled the access would help to test and run it on weekend

TomFreudenberg commented 8 years ago

After checking the board for the first time, its proc is aarch64 = armv8.

It is currenly (meteor <=1.2.x) not possible to build dev_bundle on that board in case of missing "v8" sources. I will give it a try when the new port 1.3.x is ready. Maybe we get a chance with a newer node/v8 release

Sing-Li commented 8 years ago

Thanks! That will be perfect timing. We will be upgrading Rocket.Chat to 1.3.x in a couple of weeks, currently waiting for minor bug fixes - and started to update our own support for ES6 modules and npm based packages.

meteorza commented 8 years ago

Hi there. Any progress or new developments regarding meteor support for ARMv8?

I have built an Ubuntu Linux ARM Image that runs on older ARM media player. Its main function is to act as an inexpensive satellite router.

Before I have installed meteor on these older ARM device and it worked well. The older media player model has now been discontinued and I can only get an ARMv8 box with the functionality we require (tuner, etc). This is the problem, I can not build Meteor on it. It seems like we might have to move to another framework because Meteor does not support ARMv8. Not something I want to do seeing that I love meteor, but I can not delay it for much longer.

TomFreudenberg commented 8 years ago

Hi @meteorza unfortunately it is currently not possible to bring meteor on the armv8 architecture with bundled packages. What you can try and that might work now with the 1.3.4 release:

Install mongo from apt, get nodejs v4 from github and build yourself, check that the commands for mongo and node are in $PATH. Then you can clone the latest universal fork and run scripts/generate-dev-bundle.sh. This should respect the binaries in $PATH and just link them. After that procedure you should have a locale devbundle...tar.gz in your meteor directory. When running meteor --version this should be untared and you might get a working 1.3.4 environment.

Check the gist from @TPXP and the discussion update changes to his meteor for node v4 at: https://github.com/4commerce-technologies-AG/meteor/issues/38#issuecomment-227011971

Maybe you need to adjust some lines for npm dependencies from hist gist.

Make sure that you have your pre-requistes

sudo apt-get install build-essential debian-keyring autoconf automake libtool flex bison scons git mongodb

I would say 90% chance that it will work with some little adjustments.

If you can make a ssh tunnel to your machine, I am interested in supporting you.

Cheers Tom

TomFreudenberg commented 8 years ago

@Sing-Li - please checkout my comment https://github.com/4commerce-technologies-AG/meteor/issues/42#issuecomment-228319009 - maybe a new try :-)

TomFreudenberg commented 8 years ago

@meteorza my assumption won't work because the arch is currently not allowed in the scripts. I doing this by now.

meteorza commented 8 years ago

Thank you Tom. What I have done so far was to:

git clone https://github.com/meteor/meteor.git -b release-1.4

and

scripts/generate-dev-bundle.sh

on an amd64 platform. Everything worked and I created a basic test app. So I am using node 4.4.5 with meteor on the Intel box. Then I created a meteor build for my app.

On the ARMv8 box I also install node 4.4.5 for arm64 and mongo. Node and npm shows correct versions (4.4.5 and 2.5.15). Extracted my meteor app on the ARMv8. I then try to run the app using:

PORT=3000 MONGO_URL=mongodb://localhost:27017/testapp ROOT_URL=http://192.168.1.254 node main.js

and it complained it can not find fibers module.

So I run "npm -g install fibers" and get the error:

Unsupported (?) architecture: arm64

and this is where I get stuck. So fibers not supported on arm64?

TomFreudenberg commented 8 years ago

Yes, this is what I also got last time. I have done a lot of porting last time and maybe I can finish it this time.

I am currently waiting for my access to the linaro cluster to check whats possible. I will keep you informed.

Thanks for your research infos

Tom

TomFreudenberg commented 8 years ago

Just to let you know why:

https://github.com/laverdet/node-fibers/blob/dfb51692edc6f93787c602ede6c08067f9ce7bf3/build.js#L26-L29

I checked the sources, might not be a big problem to update - currently waiting for a system to run on :-)

TomFreudenberg commented 8 years ago

@meteorza - please, what is your output when running

uname -m

on your board?

TomFreudenberg commented 8 years ago

Hi @meteorza

I am currently struggling with babel-cli - there is some error on arm64

You can already try to use my fibers fork

npm install fibers@https://github.com/4commerce-technologies-AG/node-fibers.git#v1.0.13-patch-arm64

or check for

"fibers": "1.0.13"

and replace by

fibers: "https://github.com/4commerce-technologies-AG/node-fibers.git#v1.0.13-patch-arm64"

I will make a PR to lavender when ready

meteorza commented 8 years ago

Hi Tom

Apologies for only getting back to you now.

uname -a Linux myhostname 3.14.70 #1 SMP Tue May 24 07:20:55 +06 2016 aarch64 aarch64 aarch64 GNU/Linux

lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 14.04.4 LTS Release: 14.04 Codename: trusty

TomFreudenberg commented 8 years ago

;-) no problem - thanks ... so it seems aarch64 ist the architecture id - its same on my side

meteorza commented 8 years ago

Brilliant Tom, the basic app runs with your fibers fork on my ARMV8.

I will make the build for the full meteor app and see if I run into any problems. I am so excited now..

TomFreudenberg commented 8 years ago

I have added an issue to the babel tracker at: https://phabricator.babeljs.io/T7457

meteorza commented 8 years ago

Hi there Tom

So basic app worked with your fibers patch. I tried an app with more packages. It includes meteor-accounts and so it needs bcrypt :-(

After my extracted my build app on the ARMV8 box, I ran:

npm install fibers@https://github.com/4commerce-technologies-AG/node-fibers.git#v1.0.13-patch-arm64
npm  install 
npm install bcrypt

Everything installed fine, but when I run the app, I get the following error

 /usr/local/mytestapp/programs/server/node_modules/fibers/future.js:280
                                                throw(ex);
                                                ^
``
Error: /usr/local/mytestapp/programs/server/npm/node_modules/meteor/npm-bcrypt/node_modules/bcrypt/build/Release/bcrypt_lib.node: cannot open shared object file: No such file or directory
    at Error (native)
    at Object.Module._extensions..node (module.js:434:18)
    at Module.load (module.js:343:32)
    at Module.Mp.load (/usr/local/mytestapp/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/reify/node/runtime.js:16:23)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at bindings (/usr/local/mytestapp/programs/server/npm/node_modules/meteor/npm-bcrypt/node_modules/bcrypt/node_modules/bindings/bindings.js:76:44)
    at Object.<anonymous> (/usr/local/mytestapp/programs/server/npm/node_modules/meteor/npm-bcrypt/node_modules/bcrypt/bcrypt.js:3:35)
    at Module._compile (module.js:409:26)

Please remember that the app was built on an Intel box using mdg's release 1.4 branch and is being deployed on my ARMV8 box.

Is this related to the same babel problem you are experiencing?

meteorza commented 8 years ago

Not to worry Tom, I solved it by:

npm install bcrypt
rm -rf /usr/local/mytestapp/programs/server/npm/node_modules/meteor/npm-bcrypt/node_modules/bcrypt
npm install -g bcrypt
cp -r /usr/local/lib/node_modules/bcrypt /usr/local/mytestapp/programs/server/npm/node_modules/meteor/npm-bcrypt/node_modules/
TomFreudenberg commented 8 years ago

Hi @meteorza

sounds like you got your app running on ARM64 :-) Correct?

Just one thing about deployment until I have finished the dev_bundle:

  1. On your dev machine you run: meteor build --directory /tmp/myapp
  2. Make yourself an archive: cd /tmp; tar -cvzf myapp.tgz ./myapp
  3. Copy that archive to your ARM64 machine like: scp myapp.tgz user@arm64:/tmp
  4. Ssh to your ARM64 machine
  5. Unpack your app archive: cd /home; tar -xvzf /tmp/myapp.tgz
  6. Finish npms for your server: cd /home/myapp/bundle/programs/server
  7. Edit json and change fibers to my github line: vi package.json
  8. Run installation of npms: npm install
  9. Now you should be able to run the main.js
  10. Go back to bundle main path: cd /home/myapp/bundle
  11. Run: MONGO_URL="mongodb://localhost:27017/myapp" ROOT_URL="http://localhost:3000" PORT=3000 node main.js

That should do the job completely and you shouldn't need to install some npms somewhere else or globally.

Could you please check that.

Cheers Tom

TomFreudenberg commented 8 years ago

@Sing-Li - Same procedure as here: https://github.com/4commerce-technologies-AG/meteor/issues/42#issuecomment-228594289 should do the job for Rocket.Chat if you can run it on meteor 1.4-beta already?

meteorza commented 8 years ago

Hi Tom

Step 5. Should be cd /home; tar -xvzf myapp.tgz Step 7. When I enter your fibers github link in the package.json, npm install complains the link does not exist. So I run
npm install fibers@https://github.com/4commerce-technologies-AG/node-fibers.git#v1.0.13-patch-arm64 before I run npm install

yes, then you are able to launch app on ARMV8.

If you add a package to you app like meteor accounts, then meteor requires npm-bcrypt. Then you can not launch your apps if you follow these steps. The only I got it to work was to run :

npm install bcrypt
rm -rf /usr/local/mytestapp/programs/server/npm/node_modules/meteor/npm-bcrypt/node_modules/bcrypt
npm install -g bcrypt
cp -r /usr/local/lib/node_modules/bcrypt /usr/local/mytestapp/programs/server/npm/node_modules/meteor/npm-bcrypt/node_modules/

after I ran npm-install.

When I ran npm-installon its own, it did not install npm-bcrypt for me. Maybe I am doing something wrong but I am just happy it works (for now).

TomFreudenberg commented 8 years ago

Hi @meteorza

thanks for reply, I will check that with the simple-todos-react example. It has all the packages we are currently struggling with.

But in any way - great to know that you are fine yet :-)

meteorza commented 8 years ago

I think the link in package.json for should be:

"fibers": "git+https://github.com/4commerce-technologies-AG/node-fibers.git#v1.0.13-patch-arm64"

TomFreudenberg commented 8 years ago

You may see here the patch I added to our repo

https://github.com/4commerce-technologies-AG/meteor/commit/6a5906dda9ccec28aa3c605124ae278c01d06781

it looks like

"fibers": "https://github.com/4commerce-technologies-AG/node-fibers.git#v1.0.13-patch-arm64"

TomFreudenberg commented 8 years ago

Well, the issue for babel on node-4.4.6 is fixed. I will provide a patch until this is include into 4.4.7

see: https://github.com/nodejs/node/issues/7417

TomFreudenberg commented 8 years ago

After using our patched nodejs 4.4.6 and the arm64 updated node-fibers, meteor-1.4-beta is now available on ARM64 architecture

meteorza commented 8 years ago

Well done Tom. I will test with with 4.4.6 as soon as I get a chance.

TomFreudenberg commented 8 years ago

Just wait for some few steps to finish, otherwise you have to rebuild all by yourself.

TomFreudenberg commented 8 years ago

@meteorza @others_interested_in_aarch64

I have placed a first beta from beta.6 on bintray. So if you are running the normal checkout by

git clone --depth 1 --branch release-1.4-universal-beta https://github.com/4commerce-technologies-AG/meteor.git

and run

meteor --version

afterwards, you will automatically get a first beta binary. It runs already pretty well.

Cheers Tom

meteorza commented 8 years ago

Great Tom, thank you, will have a look.

TomFreudenberg commented 8 years ago

Issue with mongo shell 3.2.x is related #57

sg-11 commented 7 years ago

first i got:

debian@pine64:~/meteor$ scripts/generate-dev-bundle.sh CHECKOUT DIR IS /home/debian/meteor BUILDING DEV BUNDLE 0.6.15 IN /tmp/generate-dev-bundle-VGpmb5gs scripts/generate-dev-bundle.sh: line 97: cd: /tmp/generate-dev-bundle-VGpmb5gs/lib: No such file or directory debian@pine64:~/meteor$

i tried to comment line 97. then i get

debian@pine64:~/meteor$ scripts/generate-dev-bundle.sh CHECKOUT DIR IS /home/debian/meteor BUILDING DEV BUNDLE 0.6.15 IN /tmp/generate-dev-bundle-PdFvau6f /tmp/generate-dev-bundle-PdFvau6f/bin/node /tmp/generate-dev-bundle-PdFvau6f/bin/npm { npm: '2.15.9', ares: '1.10.1-DEV', http_parser: '2.7.0', icu: '56.1', modules: '46', node: '4.6.1', openssl: '1.0.2j', uv: '1.9.1', v8: '4.5.103.37', zlib: '1.2.8' } npm WARN package.json meteor-dev-bundle@0.0.0 No description npm WARN package.json meteor-dev-bundle@0.0.0 No repository field. npm WARN package.json meteor-dev-bundle@0.0.0 No README data npm WARN package.json meteor-dev-bundle@0.0.0 No license field.

fibers@1.0.13 install /tmp/generate-dev-bundle-PdFvau6f/build/npm-server-install/node_modules/fibers node build.js || nodejs build.js

Unsupported (?) architecture: arm64 sh: 1: nodejs: not found npm ERR! Linux 3.10.102-0-pine64-longsleep npm ERR! argv "/usr/local/bin/node" "/tmp/generate-dev-bundle-PdFvau6f/bin/npm" "install" npm ERR! node v4.6.1 npm ERR! npm v2.15.9 npm ERR! file sh npm ERR! code ELIFECYCLE npm ERR! errno ENOENT npm ERR! syscall spawn

npm ERR! fibers@1.0.13 install: node build.js || nodejs build.js npm ERR! spawn ENOENT npm ERR! npm ERR! Failed at the fibers@1.0.13 install script 'node build.js || nodejs build.js'. npm ERR! This is most likely a problem with the fibers package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node build.js || nodejs build.js npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs fibers npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm ERR! npm owner ls fibers npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /tmp/generate-dev-bundle-PdFvau6f/build/npm-server-install/npm-debug.log debian@pine64:~/meteor$

TPXP commented 7 years ago

Why are you trying to build the developer bundle ? There is already a prebuilt bundle available on the bintray, which the code from the release-1.4-universal-beta branch should fetch automatically.

sg-11 commented 7 years ago

o downloaded the dev_bundle_Linux_aarch64_4.0.15.tar.gz and extracted it to the folder meteor...what to do then? is there a tutorial?

TPXP commented 7 years ago

This should not be required. All you have to do is cloning the repo then starting meteor, as said here https://github.com/4commerce-technologies-AG/meteor/issues/42#issuecomment-229900554