Closed Bug 979827 Opened 10 years ago Closed 9 years ago

[Build] check node version of environment.

Categories

(Firefox OS Graveyard :: Gaia, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: gduan, Assigned: gduan)

Details

Attachments

(2 files, 3 obsolete files)

We should check the version of nodejs in case that user's nodejs is too old to run gaia.
Attached file PR to bubble-tea (obsolete) —
Assignee: nobody → gduan
Comment on attachment 8386015 [details] [review]
PR to bubble-tea

Hi Yuren,
could you help me to review this patch? 
When user try to make but the node version is less than what package.json is defined, then we'll print msg in yellow.
Attachment #8386015 - Flags: review?(yurenju.mozilla)
Comment on attachment 8386015 [details] [review]
PR to bubble-tea

We should only check the majar version change such as 0.8 -> 0.10 to only ensure using same APIs and keep it simple.
Attachment #8386015 - Flags: review?(yurenju.mozilla)
Comment on attachment 8386015 [details] [review]
PR to bubble-tea

Hi Yuren,
patch's updated, we only check the major version of nodejs,
please kindly check again, thanks.
Attachment #8386015 - Flags: review?(yurenju.mozilla)
Attached file PR to master (obsolete) —
Attachment #8386015 - Attachment is obsolete: true
Attachment #8386015 - Flags: review?(yurenju.mozilla)
Comment on attachment 8390996 [details] [review]
PR to master

Hi Yuren,
travis is all green, would you mind to check this patch? Thanks.
Attachment #8390996 - Flags: review?(yurenju.mozilla)
Comment on attachment 8390996 [details] [review]
PR to master

let's check it in makefile, please see my comments on github.
Attachment #8390996 - Flags: review?(yurenju.mozilla)
Comment on attachment 8390996 [details] [review]
PR to master

Thanks, I updated, please kindly check again!
Attachment #8390996 - Flags: review?(yurenju.mozilla)
Comment on attachment 8390996 [details] [review]
PR to master

r=yurenju, thanks!
Attachment #8390996 - Flags: review?(yurenju.mozilla) → review+
Thanks, 
merge into master 
https://github.com/mozilla-b2g/gaia/commit/c23af48b0a02667ae378bd32e8ae60eaced8e4c1
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
I had to revert this for breaking B2G desktop builds on TBPL.
https://github.com/mozilla-b2g/gaia/commit/190bb06a61f045a6b8f05b6be51602de8ec67059


The failure looked like this:

make[5]: Entering directory `/builds/slave/b2g-in-l64_g-00000000000000000/build/obj-firefox/b2g/gaia'
../../dist/bin/nsinstall -R -m 755 'b2g' '../../dist/bin'
make -j1 -C /builds/slave/b2g-in-l64_g-00000000000000000/build/gaia clean
cut: only one type of list may be specified
Try `cut --help' for more information.
/bin/bash: node: command not found
cut: only one type of list may be specified
Try `cut --help' for more information.
make[6]: Entering directory `/builds/slave/b2g-in-l64_g-00000000000000000/build/gaia'
make[6]: warning: -jN forced in submake: disabling jobserver mode.
rm -rf profile profile-debug profile-test profile build_stage docs
make[6]: Leaving directory `/builds/slave/b2g-in-l64_g-00000000000000000/build/gaia'
make -j1 -C /builds/slave/b2g-in-l64_g-00000000000000000/build/gaia profile
cut: only one type of list may be specified
Try `cut --help' for more information.
/bin/bash: node: command not found
cut: only one type of list may be specified
Try `cut --help' for more information.
make[6]: Entering directory `/builds/slave/b2g-in-l64_g-00000000000000000/build/gaia'
make[6]: warning: -jN forced in submake: disabling jobserver mode.
wget -q -c https://github.com/mozilla-b2g/gaia-node-modules/tarball/master
mv master "modules.tar"
tar --wildcards --strip-components 1 -x -m -f modules.tar "mozilla-b2g-gaia-node-modules-*/node_modules"
npm install && npm rebuild
/bin/bash: npm: command not found
make[6]: *** [node_modules] Error 127
make[6]: Leaving directory `/builds/slave/b2g-in-l64_g-00000000000000000/build/gaia'
make[5]: *** [libs] Error 2
make[5]: Leaving directory `/builds/slave/b2g-in-l64_g-00000000000000000/build/obj-firefox/b2g/gaia'
make[4]: *** [b2g/gaia/libs] Error 2
make[4]: Leaving directory `/builds/slave/b2g-in-l64_g-00000000000000000/build/obj-firefox'
make[3]: *** [libs] Error 2
make[3]: Leaving directory `/builds/slave/b2g-in-l64_g-00000000000000000/build/obj-firefox'
make[2]: *** [default] Error 2
make[2]: Leaving directory `/builds/slave/b2g-in-l64_g-00000000000000000/build/obj-firefox'
make[1]: *** [realbuild] Error 2
make[1]: Leaving directory `/builds/slave/b2g-in-l64_g-00000000000000000/build'
make: *** [build] Error 2
State Changed: unlock buildroot
program finished with exit code 2
Flags: needinfo?(gduan)
Attached file PR to master (obsolete) —
Will run on try-server.
Flags: needinfo?(gduan)
Attachment #8390996 - Attachment is obsolete: true
Comment on attachment 8392698 [details] [review]
PR to master

https://tbpl.mozilla.org/?tree=Try&rev=ed554a964738
Travis pass.

The patch will check the node version if the env support node.
Please kindly review it again. Thanks!
Attachment #8392698 - Flags: review?(yurenju.mozilla)
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment on attachment 8392698 [details] [review]
PR to master

r=yurenju if nit is addressed
Attachment #8392698 - Flags: review?(yurenju.mozilla) → review+
Merge to master,
https://github.com/mozilla-b2g/gaia/commit/11d6cd3d50c5a92a85a738a8de5a36932c8a89e6
Status: REOPENED → RESOLVED
Closed: 10 years ago10 years ago
Resolution: --- → FIXED
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attached file PR to master
push to master again
Attachment #8392698 - Attachment is obsolete: true
Comment on attachment 8617074 [details] [review]
PR to master

Hi Ricky,
it's an old bug which will make sure node's major version is what our build script expect. Please kindly check.
Attachment #8617074 - Flags: review?(rchien)
Comment on attachment 8617074 [details] [review]
PR to master

Well done George! I put a nit on Github and let's land it!
Attachment #8617074 - Flags: review?(rchien) → review+
thanks, master: https://github.com/mozilla-b2g/gaia/commit/328f2705b790a0cc967eb71a4604c896a6be011a
Status: REOPENED → RESOLVED
Closed: 10 years ago9 years ago
Resolution: --- → FIXED
I get this error on my Debian stable after this commit:
  cut: only one type of list may be specified

You need to use "-f 1,2" or "-f1,2".

But "cut" is not really cross platform, so you should really consider awk:

  echo $(NODE_VERSION) | awk -F. '{ print $1, $2 }

In the mean time I backout this patch, sorry.

reverted on master: 0d25492801f93fb78bc65d06176c79de5fd86ee5
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attached file PR to master
Hi Julien,
Thanks, I use sed command instead. 
Could you kindly help to review it?
Thanks!
Attachment #8622339 - Flags: review?(felash)
Comment on attachment 8622339 [details] [review]
PR to master

I prefer the version that uses awk because I find it's more readable, but if you prefer to land the sed version please do -- both work for me.
Attachment #8622339 - Flags: review?(felash) → review+
Thanks for your comments on github!
in makefile using awk -F. '{ print $$1, $$2 } instead.

master: 
https://github.com/mozilla-b2g/gaia/commit/9ecbc39ec1c641e7520757b84839025189457b7c
Status: REOPENED → RESOLVED
Closed: 9 years ago9 years ago
Resolution: --- → FIXED
I think we could've used this https://docs.npmjs.com/files/package.json#engines

Along with engineStrict which we already use for ensuring npm v2.x is installed.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: