Open vapier opened 6 years ago
I didn't know about this. Definitely worth doing! Shouldn't be hard at all. Thanks for the detailed write-up.
Assigning to myself for now, but if you want to undertake this, let me know.
i wrote a python script that might simplify things: https://chromium-review.googlesource.com/c/apps/libapps/+/843816/1/libdot/bin/plugin-to-platform-specific.py
once the manifest & nexe's have been created, run it against the app output dir:
$ .../plugin-to-platform-specific.py --output $OUTPUT/_platform_specific --input $OUTPUT
that'll rewrite the nmf file for you and relocate all the nexe files to the appropriate _platform_specific/ subdir.
currently the chrome app shipped to end users include all nexe files for all architectures which can waste ~10MB of disk (and whatever network transfer overhead)
the manifest.json format actually offers a solution specifically for this:
and offers an example manifest.json:
the docs there are a bit light on details as to the requirements of these fields, but having done some experiments with other apps (and read a bit of the server side CWS code), i think the only requirement is that
sub_package_path
be a directory. so if you want to keep most everything in the top level:then the
mosh_client_manifest_all_architectures.nmf
would read:then you'd add this snippet to
manifest.json
:then when users install the extension, CWS would detect the architecture of the client and automatically elide unsupported architectures. so on my arm system, i would only have the
arm/
subdir ...x86-32/
andx86-64/
wouldn't exist.with my suggested layout above, i don't think you'd need to change any of the existing JS or HTML code. only update the nacl related bits.