Closed Bug 1190522 Opened 9 years ago Closed 9 years ago

Rewrite pkg-dmg in Python

Categories

(Firefox Build System :: General, defect)

defect
Not set
normal

Tracking

(firefox43 fixed)

RESOLVED FIXED
mozilla43
Tracking Status
firefox43 --- fixed

People

(Reporter: ted, Assigned: ted)

References

Details

Attachments

(1 file)

In bug 935237 I want to fix things so we can build DMGs on Linux using a slightly different set of tools. Right now the script that wraps DMG creation is pkg-dmg, a Perl script with a whole bunch of features we're not using. Instead of hacking on that I'm just going to port the small set of features we actually use to a Python script and then work from there.
bug 1190522 - Rewrite pkg-dmg as a Python script. r?gps
Attachment #8642572 - Flags: review?(gps)
I tested this by running `mach package` with the same build before and after applying my patch and the contents of the DMG files (when mounted on OS X) look identical.
Comment on attachment 8642572 [details]
MozReview Request: bug 1190522 - Rewrite pkg-dmg as a Python script. r?gps

https://reviewboard.mozilla.org/r/14733/#review13365

::: python/mozbuild/mozpack/dmg.py:66
(Diff revision 1)
> +        os.symlink('/Applications', os.path.join(stagedir, ' '))

What is the significance of a filename with a space? Please comment!

::: python/mozbuild/mozbuild/action/make_dmg.py:33
(Diff revision 1)
> +    except Exception:

Is this needed? Python will print the exception and exit 1 if an exception is uncaught.

::: python/mozbuild/mozbuild/action/make_dmg.py:10
(Diff revision 1)
> +import buildconfig

Unused import?
Attachment #8642572 - Flags: review?(gps) → review+
https://reviewboard.mozilla.org/r/14733/#review13365

> Unused import?

Oops, yeah. I was going to use buildconfig but wound up using MozbuildObject.

> Is this needed? Python will print the exception and exit 1 if an exception is uncaught.

I guess not, I wasn't sure what the right thing to do in a py_action script was. That seems fine.

> What is the significance of a filename with a space? Please comment!

Good point. :) This was basically just ported from the pkg-dmg invocation.
(In reply to Ted Mielczarek [:ted.mielczarek] from comment #6)
> https://treeherder.mozilla.org/#/jobs?repo=try&revision=cef67839356b

This failed in universal builds with an ObjdirMismatchException trying to use MozbuildObject.from_environment. As it turns out we have support for handling MOZ_CURRENT_PROJECT in from_environment:
https://hg.mozilla.org/mozilla-central/annotate/2ddec2dedced/python/mozbuild/mozbuild/base.py#l167

...but for universal builds we invoke a bunch of automation targets directly in one of the objdirs, and not via client.mk:
https://hg.mozilla.org/mozilla-central/annotate/2ddec2dedced/python/mozbuild/mozbuild/mach_commands.py#l394

The extra change I pushed to try there should hopefully make this work by passing MOZ_BUILD_PROJECT for this extra make invocation.
Oops, that one was busted, trying again: https://treeherder.mozilla.org/#/jobs?repo=try&revision=8831f31698d2

That push looks good, I'll get that additional patch up for review.
Depends on: 1191598
url:        https://hg.mozilla.org/integration/mozilla-inbound/rev/bca1ad6cc3781af4b8c8667ccb3c29e5bcb50ea9
changeset:  bca1ad6cc3781af4b8c8667ccb3c29e5bcb50ea9
user:       Ted Mielczarek <ted@mielczarek.org>
date:       Mon Aug 03 15:40:04 2015 -0400
description:
bug 1190522 - Rewrite pkg-dmg as a Python script. r=gps
Trying to fix the dumb B2G desktop builds by just copying some files from the Firefox Nightly branding:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=329d82fb1dfb
url:        https://hg.mozilla.org/integration/mozilla-inbound/rev/31a7d7a1c7e86619e76e794b53d0d208bfda108d
changeset:  31a7d7a1c7e86619e76e794b53d0d208bfda108d
user:       Ted Mielczarek <ted@mielczarek.org>
date:       Tue Aug 11 14:11:04 2015 -0400
description:
bug 1190522 - Add some extra OS X DMG-related branding files to B2G desktop branding. r=mshal

url:        https://hg.mozilla.org/integration/mozilla-inbound/rev/3747bcb215b12af8c5e301d818d0d4adf76f7a32
changeset:  3747bcb215b12af8c5e301d818d0d4adf76f7a32
user:       Ted Mielczarek <ted@mielczarek.org>
date:       Mon Aug 03 15:40:04 2015 -0400
description:
bug 1190522 - Rewrite pkg-dmg as a Python script. r=gps
Got r=mshal over IRC for that dumb branding patch, Try looked good.
url:        https://hg.mozilla.org/projects/larch/rev/ddf38379ac49588a5d6d5922678cc12941c6ec68
changeset:  ddf38379ac49588a5d6d5922678cc12941c6ec68
user:       Brian R. Bondy <netzen@gmail.com>
date:       Fri Aug 14 15:36:34 2015 -0400
description:
bug 1190522 - Add placeholders for branding files for browser.html and horizon. r=fabrice
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: