зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1484473 - Add a cbindgen version check. r=firefox-build-system-reviewers,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D3718 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
384be24476
Коммит
bb604b0dee
|
@ -289,6 +289,28 @@ cbindgen = check_prog('CBINDGEN', add_rustup_path('cbindgen'), paths=toolchain_s
|
|||
when=depends(build_project)
|
||||
(lambda build_project: build_project != 'js'))
|
||||
|
||||
|
||||
@depends_if(cbindgen)
|
||||
@checking('cbindgen version')
|
||||
@imports(_from='textwrap', _import='dedent')
|
||||
def cbindgen_version(cbindgen):
|
||||
cbindgen_min_version = Version('0.6.1')
|
||||
|
||||
# cbindgen x.y.z
|
||||
version = Version(check_cmd_output(cbindgen, '--version').strip().split(" ")[1])
|
||||
|
||||
if version < cbindgen_min_version:
|
||||
die(dedent('''\
|
||||
cbindgen version {} is too old. At least version {} is required.
|
||||
|
||||
Please update using 'cargo install cbindgen --force' or running
|
||||
'./mach bootstrap', after removing the existing executable located at
|
||||
{}.
|
||||
'''.format(version, cbindgen_min_version, cbindgen)))
|
||||
|
||||
return version
|
||||
|
||||
|
||||
# Bindgen can use rustfmt to format Rust file, but it's not required.
|
||||
js_option(env='RUSTFMT', nargs=1, help='Path to the rustfmt program')
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#!/bin/bash
|
||||
set -x -e -v
|
||||
|
||||
# If you update this, make sure to update the minimum version in rust.configure
|
||||
# as well.
|
||||
CBINDGEN_VERSION=v0.6.1
|
||||
TARGET="$1"
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче