author Nick Alexander <>
Tue, 18 Dec 2018 23:01:16 +0000
changeset 511200 c15860d7d189eedc89ff61ca4e0bd145e71c151b
parent 476323 da3c81f986fa63b42a2874b1791eddcdbfbe8424
permissions -rw-r--r--
Bug 1509573 - Part 3: Use |make -C ... stage-package| rather than special Make target. r=snorp This splits the two stage-package invocations (which are rather slow) between Fennec and GeckoView, hopefully speeding local GV development up a little (in the IDE). The stage-package invocations depend on |mach build faster|, because the omnijar contents might need to be updated. In addition, we feed the packaged libs (and asset libs) through. Differential Revision:

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at

import os
import errno

def mtime(path):
        return os.stat(path).st_mtime
    except OSError as e:
        if e.errno == errno.ENOENT:
            return -1

def rebuild_check(args):
    target = args[0]
    deps = args[1:]
    t = mtime(target)
    if t < 0:

    newer = []
    removed = []
    for dep in deps:
        deptime = mtime(dep)
        if deptime < 0:
        elif mtime(dep) > t:

    if newer and removed:
        print('Rebuilding %s because %s changed and %s was removed' % (
            target, ', '.join(newer), ', '.join(removed)))
    elif newer:
        print('Rebuilding %s because %s changed' % (target, ', '.join(newer)))
    elif removed:
        print('Rebuilding %s because %s was removed' % (
            target, ', '.join(removed)))
        print('Rebuilding %s for an unknown reason' % target)

if __name__ == '__main__':
    import sys