Closed Bug 975233 Opened 11 years ago Closed 11 years ago

use |tar --strip 1| instead of |tar && mv && rm| in Makefile

Categories

(Firefox OS Graveyard :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: yurenju, Assigned: gsvelto)

References

Details

(Whiteboard: [good first bug][mentor=yurenju][mentor-lang=zh])

Attachments

(2 files, 1 obsolete file)

Kevin saved gaia from hell with downloading npm tarball from github, now it's time to polish this command. we should use |tar --strip 1| instead of |tar && mv && rm| in Makefile[1] [1] https://github.com/mozilla-b2g/gaia/blob/e542540cfa64c31ac8bb71b1a9cf16879fc9d58e/Makefile#L681-L693
set needinfo flag to me on bottom of coment box if you are interested in, check the checkbox which is left of "need more information from other" and fill my email.
See Also: → 975395
This patch uses --strip-components to extract only the node_modules directory and do so in the right spot but also reorganizes the rule around it to fix a few common issues: - if the node_modules directory is not present but modules.tar is then we didn't rebuild node_modules, this is obviously wrong - we extracted node_modules without touching it so it appeared as always old from make POV, this is also addressed by passing the |-m| flag to the tar invocation - the node_modules rule depended on $(NPM_INSTALLED_PROGRAMS) and not vice-versa, so if you tried to explicitly |make node_modules| you'd get three invocations of the $(NPM_INSTALLED_PROGRAMS) rule which is wrong and lead to funny errors (like trying to download three copies of the tarball at the same time)
Assignee: nobody → gsvelto
Status: NEW → ASSIGNED
Attachment #8379731 - Flags: review?(yurenju.mozilla)
Scratch the previous patch, apparently most recent versions of GNU tar explicitly require you to pass the |--wildcards| option if you intend to use wildcards so here goes an updated patch that deals with them.
Attachment #8379731 - Attachment is obsolete: true
Attachment #8379731 - Flags: review?(yurenju.mozilla)
Attachment #8379737 - Flags: review?(yurenju.mozilla)
Comment on attachment 8379737 [details] [diff] [review] [PATCH v2] Reorganize the rules for installing node.js modules Review of attachment 8379737 [details] [diff] [review]: ----------------------------------------------------------------- r=yurenju if nit is addressed, thank you, Gabriele! ::: Makefile @@ +689,5 @@ > + > +node_modules: modules.tar > + $(TAR_WILDCARDS) --strip-components 1 -x -m -f modules.tar "mozilla-b2g-gaia-node-modules-*/node_modules" > + npm install && npm rebuild > + echo "node_modules installed." add "@" before |echo| because we don't need to print command itself.
Attachment #8379737 - Flags: review?(yurenju.mozilla) → review+
Thanks for the review! I've turned the |echo| command into |@echo| and I'm giving this a spin on TBPL to make sure I'm not breaking anything as our automation scripts now rely on the |node_modules| target (see bug 976251): https://tbpl.mozilla.org/?tree=Try&rev=c170663117da
The previous TBPL run had some broken parameters for the custom gaia repo, I've fixed it and the new run is here: https://tbpl.mozilla.org/?tree=Try&rev=8b40ddd626f0 In the meantime this is the green Travis run: https://travis-ci.org/mozilla-b2g/gaia/builds/19560002
The TBPL test is looking good too, pushed to gaia/master 80d6405725788327102cab36e8d8c017cf25fb23
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: