mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1290957 - ensure MOZ_AUTOMATION builds require a cargo with --frozen support; r=chmanchester
We want to ensure that our automation builds don't pull in libraries from crates.io, and we need --frozen support in cargo to do that. If we don't have that support, we shouldn't build.
This commit is contained in:
parent
d7beb70278
commit
81545d0022
@ -32,12 +32,16 @@ def rustc_info(rustc):
|
||||
@depends_if(cargo)
|
||||
@checking('cargo support for --frozen')
|
||||
@imports('subprocess')
|
||||
@imports('os')
|
||||
def cargo_supports_frozen(cargo):
|
||||
try:
|
||||
lines = subprocess.check_output(
|
||||
[cargo, 'help', 'build']
|
||||
).splitlines()
|
||||
return any(' --frozen' in l for l in lines)
|
||||
supported = any(' --frozen' in l for l in lines)
|
||||
if 'MOZ_AUTOMATION' in os.environ and not supported:
|
||||
die('cargo in automation must support --frozen')
|
||||
return supported
|
||||
except subprocess.CalledProcessError as e:
|
||||
die('Failed to call cargo: %s', e.message)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user