gecko-dev/build/moz.configure/tup.configure
Mike Shal a4782418de Bug 1494833 - Bump tup version to v0.7.8; r=chmanchester
This incorporates some fixes for ccache, icecream, and a better display
output (decreasing count instead of an increasing count). It may also
let us experiment with incremental rust support, though I think that
feature still needs some more work.

MozReview-Commit-ID: 7zPGiL9Ob6N

Differential Revision: https://phabricator.services.mozilla.com/D7152

--HG--
extra : moz-landing-system : lando
2018-09-28 02:33:53 +00:00

77 lines
2.9 KiB
Python

# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# 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 http://mozilla.org/MPL/2.0/.
# tup detection
# ==============================================================
tup = check_prog('TUP', ['tup'])
@depends(tup)
@checking('for tup version')
@imports('re')
def tup_version(tup):
tup_min_version = '0.7.8'
out = check_cmd_output(tup, '--version',
onerror=lambda: die('Failed to get tup version'))
m = re.search(r'tup v?([0-9]+\.[0-9]+\.[0-9]+)', out)
if not m:
raise FatalCheckError('Unknown version of tup: %s' % out)
ver = Version(m.group(1))
if ver < tup_min_version:
raise FatalCheckError('To use the tup backend you must have tup version '
'%s or greater in your path' % tup_min_version)
return ver
@depends(tup)
@checking('for tup ldpreload dependency checker')
def tup_is_ldpreload(tup):
out = check_cmd_output(tup, 'server',
onerror=lambda: die('Failed to get tup dependency checker'))
if out.rstrip() != 'ldpreload':
raise FatalCheckError('To use the tup backend, please use a version '
'of tup compiled with the ldpreload dependency '
'checker. Either compile tup locally with '
'CONFIG_TUP_SERVER=ldpreload in your tup.config '
'file, or use the version from the toolchain '
'task via |./mach artifact toolchain '
'--from-build linux64-tup|')
return True
@depends(tup, using_sccache)
def tup_and_sccache(tup, using_sccache):
if tup and using_sccache:
die('Cannot use sccache with tup yet. Please disable sccache or use '
'the make backend until it is supported.')
@depends(tup, cargo)
@imports('re')
def check_tup_cargo_channel(tup, cargo):
channel = None
out = check_cmd_output(cargo, '--version')
VERSION_FORMAT = r'cargo \d\.\d+\.\d+-(\S+)'
m = re.match(VERSION_FORMAT, out)
if m:
channel = m.group(1)
if tup and channel != 'nightly':
die('Nightly Cargo is required when building with Tup.')
@depends(tup, target, build_project)
def tup_and_non_linux(tup, target, build_project):
if tup and (target.kernel != 'Linux' or build_project != 'browser'):
die('The tup backend can only be used to build the browser on Linux. '
'Use the make backend until your target is supported.')
option('--upload-tup-db', help= 'Upload the tup database from an automated build.')
@depends('--upload-tup-db')
def upload_tdb(value):
if value:
return True
set_config('UPLOAD_TUP_DB', upload_tdb)