Bug 1458588 - Create objdir/tmp if it doesn't exist during mach run;r=ahal
This fixes `./mach run --temp-profile` after a clobber.
MozReview-Commit-ID: 7xoH5RCSpXx
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -893,20 +893,24 @@ class RunProgram(MachCommandBase):
'browser.shell.checkDefaultBrowser': False,
'general.warnOnAboutConfig': False,
}
prefs.update(self._mach_context.settings.runprefs)
prefs.update([p.split('=', 1) for p in setpref])
for pref in prefs:
prefs[pref] = Preferences.cast(prefs[pref])
+ tmpdir = os.path.join(self.topobjdir, 'tmp')
+ if not os.path.exists(tmpdir):
+ os.makedirs(tmpdir)
+
if (temp_profile):
- path = tempfile.mkdtemp(dir=os.path.join(self.topobjdir, 'tmp'), prefix='profile-')
+ path = tempfile.mkdtemp(dir=tmpdir, prefix='profile-')
else:
- path = os.path.join(self.topobjdir, 'tmp', 'profile-default')
+ path = os.path.join(tmpdir, 'profile-default')
profile = Profile(path, preferences=prefs)
args.append('-profile')
args.append(profile.profile)
if not no_profile_option_given and setpref:
print("setpref is only supported if a profile is not specified")
return 1