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)
Firefox OS Graveyard
Gaia::Build
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
Assignee | ||
Updated•10 years ago
|
Comment 1•9 years ago
|
||
a prototype for copyToStage :
https://github.com/cctuan/gaia/commit/213a97c5a6adf0183efece83ae8c29e5fa43251c
it works fine.
Comment 2•9 years ago
|
||
1st make: 2m28
2nd make: 2m21
lol
Comment 3•9 years ago
|
||
forgot to remove clean-stage-app.
https://github.com/cctuan/gaia/commit/fd0685dbfc21b35d742dfdea7c4b20c5380cfd2f
Comment 4•9 years ago
|
||
after put -j8 in configure.js,
1st make: 1m17.492s
2nd make: 1m15.414s
Comment 5•9 years ago
|
||
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 | ||
Updated•9 years ago
|
Assignee: nobody → ricky060709
Status: NEW → ASSIGNED
Assignee | ||
Comment 6•9 years ago
|
||
Assignee | ||
Comment 7•9 years ago
|
||
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.
Comment 8•9 years ago
|
||
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.
Assignee | ||
Comment 9•9 years ago
|
||
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.
Assignee | ||
Updated•9 years ago
|
Summary: Refactoring webapp-shared.js and copyToStage for new build system → Refactoring webapp-shared.js for new build system
Comment 10•9 years ago
|
||
Assignee | ||
Comment 11•9 years ago
|
||
George, I'd like to merge this PR to your branch, please take a look if you feel free.
Attachment #8612088 -
Flags: review?(gduan)
Comment 12•9 years ago
|
||
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.
Comment 13•9 years ago
|
||
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.
Assignee | ||
Comment 14•9 years ago
|
||
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 15•9 years ago
|
||
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!
Updated•9 years ago
|
Attachment #8612088 -
Flags: review?(gduan) → review+
Assignee | ||
Comment 16•9 years ago
|
||
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)
Comment 17•9 years ago
|
||
merged!
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Flags: needinfo?(gduan)
Resolution: --- → FIXED
Comment 18•9 years ago
|
||
Hi Ricky,
it looks like there's still a bug in below,
https://github.com/cctuan/gaia/blob/config-build/build/webapp-shared.js#L137
https://s3-us-west-2.amazonaws.com/taskcluster-public-artifacts/gHVQnDjzTiyMGG9dNXLiOA/1/public/logs/live_backing.log
Flags: needinfo?(rchien)
Assignee | ||
Comment 19•9 years ago
|
||
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)
Comment 20•9 years ago
|
||
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.
Description
•