Closed Bug 1154585 Opened 10 years ago Closed 9 years ago

Refactoring webapp-shared.js for new build system

Categories

(Firefox OS Graveyard :: Gaia::Build, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: rickychien, Assigned: rickychien)

References

Details

Attachments

(2 files)

See also new build system plan milestone 1 [1] Refactoring webapp-shared.js and copyToStage: based on new build system architecture, we'll refactor webapp-shared module and copyToStage into config and execute task in order to save time when re-run make and check if any possible risk before Milestone 2 (refactoring all build modules and app/build.js). [1] https://wiki.mozilla.org/Gaia/Build/NewBuildSystem
Depends on: 1154586
Blocks: 1154586
No longer depends on: 1154586
1st make: 2m28 2nd make: 2m21 lol
after put -j8 in configure.js, 1st make: 1m17.492s 2nd make: 1m15.414s
without configure/cp.js (simply cp all the app no matter what) 1st make: 1m9.525s 2nd make: 1m10.774s (should be not much different than 1st make) with configure/cp.js (replace .PHONY with plain files dependency for copy app) 1st make: 1m17.492s 2nd make: 1m15.414s (should be less since we only copy file that we change) I think bug 1154583 can save the configuring time if it has efficient way to scan changes.
Assignee: nobody → ricky060709
Status: NEW → ASSIGNED
Here is some performance records after splitting configure and builder of webapp-shared base on WIP branch: (Clobber build) * Run webapp-shared's configure (generate webapp-shared.mk): 11.11s * Run webapp-shared.mk (copy a lot of files): 14.48s ** I guess the result of such bad performance indicates that we generate too many `cp` shell commands, and `make` process invokes `cp` processes too many times so it slows down our copy step. (Incremental build) * Modify one shared file and 'time make -f webapp-shared.mk': 0.45s As above result, we can see that we have a blazing fast incremental build in the new architecture, even though clobber build is slower than old one.
Based on you wip, I thought about a new step for each build module, let us name it 'ShouldReconfig' module. Just as its naming, we let each build step to decide whether to regenerate makefile or not, each module's ShouldReconfig module will only watch what it need to watch, for example, settings.js will only watch build/config/common-settings.json and GAIA_DEFAULT_LOCALE. Only if those value or file change, we need to rerun config step. We only reconfig necessary component instead of all if any file or env change. I think that would save more time for incremental build.
I agree with your point. However, we still have same problem in webapp-shared's configure which should detect the changes of source files in apps. The webapp-shared.js should be rerun if there are some files added or deleted.
Summary: Refactoring webapp-shared.js and copyToStage for new build system → Refactoring webapp-shared.js for new build system
George, I'd like to merge this PR to your branch, please take a look if you feel free.
Attachment #8612088 - Flags: review?(gduan)
I reset my env and use your build to make, and found out an error of "error: Using inexistent shared page file: import/js/parameters.js from: communications.gaiamobile.org" as discussed, it might be an issue that some configure steps depend on previous builder result. We probably need to rething the steps, like config -> build -> config -> build ... , or fix contacts-import-services because it generate file which does not exist in gaia tree and break your patch.
and also these two json files /shared/resources/keyboard_layouts.json /shared/js/search_providers.json perhaps just remove them from .gitignore and check into gaia.
Patch has passed linux & mac Gb test on local machine, although there are some failures on treeherder since we've switched to node as run-time which could crash build. I'm going to land it into your branch once I get r+.
Comment on attachment 8612088 [details] [review] https://github.com/cctuan/gaia/pull/10 I've compared diff with/without your patch and it looks nice. Please kindly check my comment on github, if you agree my point, please add some comment in your code or perhaps modify the library, maybe use a list to set dependency automatically. I still r+ this patch since it works just fine!
Attachment #8612088 - Flags: review?(gduan) → review+
George, could you give me a hand to merge it into your branch because I don't have permission. And also close this bug once you merge. Thanks!
Flags: needinfo?(gduan)
merged!
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Flags: needinfo?(gduan)
Resolution: --- → FIXED
I think we don't need to figure out totally the bustage from gaia-try since it probably take more time to investigate. As an experiment branch, patch passed on my local machine (both on Mac or Linux), so I'm fine to merge it into your branch first.
Flags: needinfo?(rchien)
It's easy to reproduce if your repo is cloned from github at first time or done git clean -fdx before run make. file bug 1170430 for this bug.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: