Closed Bug 1145842 Opened 5 years ago Closed 5 years ago

[Build] Include PluotSorbet emulator in build

Categories

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

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: drs, Assigned: drs)

References

Details

(Whiteboard: [spark])

Attachments

(1 file)

We've been asked to include a J2ME app pre-loaded in our build.
Preliminary patch. We're having problems installing this on the system partition, and on the Aries device.
Assignee: nobody → drs
(In reply to Doug Sherk (:drs) (use needinfo?) from comment #1)
> Preliminary patch. We're having problems installing this on the system
> partition, and on the Aries device.

This seems to be an issue with installing on the system partition, not with the Aries device. Myk, as discussed on Friday, could you take a look? I suspect that this is a platform issue, but if you can isolate what is going wrong in the JS, it will be easier to pull in platform people to help us.
Flags: needinfo?(myk)
(In reply to Doug Sherk (:drs) (use needinfo?) from comment #2)
> (In reply to Doug Sherk (:drs) (use needinfo?) from comment #1)
> > Preliminary patch. We're having problems installing this on the system
> > partition, and on the Aries device.
> 
> This seems to be an issue with installing on the system partition, not with
> the Aries device. Myk, as discussed on Friday, could you take a look? I
> suspect that this is a platform issue, but if you can isolate what is going
> wrong in the JS, it will be easier to pull in platform people to help us.

Yes, I'm going to dig into this on my Flame running a 3.0 nightly build of B2G, as it appears to have the same issue you noticed on the Aries when the app is installed to the system partition.
For reference, I checked if the Gaia build is doing anything strange when it builds the app package, but it seems to be almost identical. The only differences are that it doesn't copy some of the images, and the manifest.webapp gets minified.
The minified manifest.webapp file shouldn't be a problem.  And those images are probably ok too.  I'm not super-familiar with the Gaia build process, but it looks like Gaia is picking an image from among the options.

For example, a recursive diff between the apps/j2me/ source directory and the contents of the relevant application.zip file in gaia/profile/webapps/ shows that style/progress_activity/images/ui/light.png is different, and that three related light*.png files are only in the source directory:

Only in apps/j2me/style/progress_activity/images/ui: light@1.5x.png
Only in apps/j2me/style/progress_activity/images/ui: light@2.25x.png
Only in apps/j2me/style/progress_activity/images/ui: light@2x.png

But light.png in application.zip is identical to light@2.25x.png in the source directory.  So presumably Gaia is picking the image with the best resolution for the target device.


Nevertheless, I do see one more difference, which accounts for the "JVM/J2ME is undefined" errors on startup: the build/ directory, which contains the j2me.js script that defines those objects, is missing from application.zip.

As for why it's missing, my first guess would be that perhaps the Gaia build system is excluding directories named "build" when it packages an app's files into its application.zip file.  I'll need to dig a bit more to confirm that theory, however.
(In reply to Myk Melez [:myk] [@mykmelez] from comment #5)
> As for why it's missing, my first guess would be that perhaps the Gaia build
> system is excluding directories named "build" when it packages an app's
> files into its application.zip file.  I'll need to dig a bit more to confirm
> that theory, however.

Yes, that appears to be the reason.  In <https://github.com/mozilla/j2me.js/pull/1302>, I've renamed the build/ directory to bld/, which works around the problem.  Once that lands, I'll spin a new package.
Flags: needinfo?(myk)
Comment on attachment 8580927 [details] [review]
Include J2ME emulator in build.

The PR has landed but hasn't propagated to the Marketplace app yet. Let's just review and land the build side of this anyways, and we can iterate if needed.
Attachment #8580927 - Flags: review?(kgrandon)
Comment on attachment 8580927 [details] [review]
Include J2ME emulator in build.

Left some comments on github. This looks sane and the code is easy to read/follow. Nice work.
Attachment #8580927 - Flags: review?(kgrandon) → review+
Bill and I have now updated the build in Marketplace, so it should work when installed onto the system partition.
I tested this, and with the latest Marketplace app, it works. Thanks for your investigation, Myk.

https://github.com/fxos/lightsaber/commit/94d698eddc095f6dc2fe96ba31ab1d2ed558a8d3
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Whiteboard: [lightsaber] → [ignite]
Whiteboard: [ignite] → [spark]
Blocks: spark-build
No longer blocks: spark
Component: Gaia → Gaia::Build
Summary: [Build] Include J2ME emulator in build → [Build] Include PluotSorbet emulator in build
You need to log in before you can comment on or make changes to this bug.