diff --git a/python/mozbuild/mozbuild/mach_commands.py b/python/mozbuild/mozbuild/mach_commands.py index 718a0a42e983..4807196cb195 100644 --- a/python/mozbuild/mozbuild/mach_commands.py +++ b/python/mozbuild/mozbuild/mach_commands.py @@ -5,6 +5,7 @@ from __future__ import absolute_import, print_function, unicode_literals import argparse +import errno import itertools import json import logging @@ -1481,6 +1482,12 @@ class PackageFrontend(MachCommandBase): state_dir = self._mach_context.state_dir cache_dir = os.path.join(state_dir, 'package-frontend') + try: + os.makedirs(cache_dir) + except OSError as e: + if e.errno != errno.EEXIST: + raise + import which if self._is_windows(): hg = which.which('hg.exe')