Misidentifies many asset files as binaries, thus preventing architecture:all packages

Bug #1591253 reported by Stuart Langridge
22
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Canonical Click Reviewers tools (obsolete)
Fix Released
Wishlist
Jamie Strandboge

Bug Description

click-review uses Python3's libmagic bindings to identify the types of files in the click package. However, it requires a mimetype to be returned and only checks that. Many file types are correctly identfied by libmagic but don't have a dedicated filetype, for example .woff files:

$ file uwp/libraries/tinymce/skins/lightgray/fonts/tinymce.woffuwp/libraries/tinymce/skins/lightgray/fonts/tinymce.woff: Web Open Font Format, flavor 65536, length 17204, version 1.0
$ file --mime-type uwp/libraries/tinymce/skins/lightgray/fonts/tinymce.woff
uwp/libraries/tinymce/skins/lightgray/fonts/tinymce.woff: application/octet-stream

Unfortunately, click-review then assumes that any file with mimetype application/octet-stream is a binary, and will therefore reject an architecture:all package which contains such a file.

The click-review tool could handle this situation better; this could be construed as a libmagic(3) bug because there's no mimetype defined for many recognised file types in the magic file, but there are always likely to be files which are not executables and which don't have a mimetype. Shipping a file of arbitrary binary data will currently cause an architecture:all package to fail click review, which is wrong. I suggest that click-review explicitly look for executables (mimetype application/x-executable) and use only their presence to reject arch:all packages, rather than to assume that any unrecognised type is an executable.

Revision history for this message
Stuart Langridge (sil) wrote :

https://bugs.launchpad.net/click-reviewers-tools/+bug/1564488 is a relevant particular occurrence of this more general bug.

Revision history for this message
Sam Segers (sam-sgrs) wrote :

Have the same problem with mp3's in my app:
https://myapps.developer.ubuntu.com/dev/click-apps/314/rev/8/

I've requested manual review. Let's see how that works.

Revision history for this message
Bristow (web-frayssinet) wrote :

Same thing here for an app in html5+js.

Revision history for this message
Bristow (web-frayssinet) wrote :
Changed in click-reviewers-tools:
status: New → Triaged
importance: Undecided → Wishlist
Changed in click-reviewers-tools:
status: Triaged → In Progress
assignee: nobody → Jamie Strandboge (jdstrand)
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

This is fixed in r752

Changed in click-reviewers-tools:
assignee: Jamie Strandboge (jdstrand) → nobody
status: In Progress → Fix Committed
Changed in click-reviewers-tools:
assignee: nobody → Jamie Strandboge (jdstrand)
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

FYI, the store now has this fix.

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

The store has had this fix for some time.

Changed in click-reviewers-tools:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.