Closed Bug 1168828 Opened 5 years ago Closed 4 years ago

GAIA_DISTRIBUTION_DIR=distros/spark make reset gaia fails on first load

Categories

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

defect

Tracking

(blocking-b2g:2.5+, b2g-master fixed)

RESOLVED FIXED
2.2 S14 (12june)
blocking-b2g 2.5+
Tracking Status
b2g-master --- fixed

People

(Reporter: daleharvey, Assigned: gduan)

References

Details

(Keywords: dogfood, Whiteboard: [bzlite][spark][systemsfe])

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:41.0) Gecko/20100101 Firefox/41.0

Seems we need to run this twice to have it work, the preload also seems to get called like 3 times during a build
Assignee: nobody → dale
George got any ideas about what could cause this? we definitely run make pre-app twice, taking a look now

https://gist.github.com/daleharvey/e2f0f189209951c27a58

it can be reproduced rm -rf distros/spark/outoftree_apps/ && GAIA_DISTRIBUTION_DIR=distros/spark make reset-gaia, you can see no of the extra apps are on the homescreen
Flags: needinfo?(gduan)
Blocks: spark-build
Component: Gaia::Feedback → Gaia::Build
Priority: -- → P1
Whiteboard: [bzlite] → [bzlite][spark]
Whiteboard: [bzlite][spark] → [bzlite][spark][systemsfe]
Target Milestone: --- → 2.2 S14 (12june)
Sorry, I didn't know preload feature from bug 1159411 .

I think GAIA_APPDIRS, which get all app dir from source tree, doesn't contain those apps before "preload" step, since they 're not in gaia tree yet.
(please check below https://github.com/mozilla-b2g/gaia/blob/master/build/scan-appdir.js#L66)
So, the webapp-manifest.json doesn't have them, and homescreen-manager cannot parse it successfully, that why you can't see those apps on homescreen...

We probably need to modify scan-appdir.js , check some list to get distribution app path (which does not exist in gaia tree yet but soon) and push to allAppList array , or move preload.js prior to the steps that requires GAIA_APPDIRS env (ex: utils.gaia.getInstance) and add those new apps' path to GAIA_APPDIRS manually.
Flags: needinfo?(gduan)
Dale, do you have any updates on this? This bug is blocking bug 1161494, which is preventing us from switching our nightly builds from lightsaber to distros/spark.
Flags: needinfo?(dale)
George, thanks for your thorough explanation. Could you help us with this? I think that the changes that you suggested may be outside of Dale's area of expertise, and it would take him quite a while to familiarize himself with it enough to be able to write this patch. We're really close to being able to build Spark completely from within the Gaia repo, as this is our last hurdle to cross. Thanks for your help and understanding.
blocking-b2g: --- → spark+
Flags: needinfo?(gduan)
Yeh I have taken a few stabs at this and had problems with the Makefile format, I think it makes sense to have preload run before scan-appdir then not need to worry about modifying, but some help on getting that done would be great
Flags: needinfo?(dale)
Hi Dale,
could you help to test it? 
https://github.com/mozilla-b2g/gaia/pull/30379
I think it makes more sense if we put preload.js there, but I found no way to execute a command without assign a variable in ifdef content, so I randomly pick a EXECUTE_PRELOAD_APP var. However, it won't affect this patch.
Flags: needinfo?(gduan) → needinfo?(dale)
Hah yeh I tried figuring out how to do it without the assignment but couldnt, testing now
Flags: needinfo?(dale)
Switching assignee since you wrote the patch, this is working perfect for me, thanks a lot
Assignee: dale → gduan
Attached file PR to master
Hi Ricky,

It seems that we should run preload.js before GAIA_ALLAPPDIRS. However, I found no way to run the command without assigning a variable to it, but it won't affect anything to the result. 
Please kindly check and suggest, thanks!
Attachment #8614616 - Flags: review?(rchien)
Attachment #8614616 - Flags: review?(rchien) → review+
master: https://github.com/mozilla-b2g/gaia/commit/51bc7a9c3bccbda44e6654fb4ed0456b4581a87c
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
blocking-b2g: spark+ → 2.5+
You need to log in before you can comment on or make changes to this bug.