Skip to content
Snippets Groups Projects
Commit 721ada9f authored by Mike Hommey's avatar Mike Hommey
Browse files

Bug 1278415 - Ensure MOZ_CURRENT_PROJECT is set when running make directly in objdir. r=gps

The topobjdir-finding logic in mozbuild relies on MOZ_CURRENT_PROJECT
being set, and it's currently only set when going through client.mk.

On automation, during universal builds, make check is invoked directly
in one of the objdirs, so MOZ_CURRENT_PROJECT is not set. We've had
other similar problems in the past. Ensuring MOZ_CURRENT_PROJECT is set
in the objdir itself should reduce the risk of other such issues in the
future.
parent 8a3b88f3
No related branches found
No related tags found
No related merge requests found
......@@ -192,6 +192,9 @@ ifdef WANT_MOZCONFIG_MK
MOZCONFIG_MK_LINES := $(filter export||% UPLOAD_EXTRA_FILES% %UPLOAD_EXTRA_FILES%,$(MOZCONFIG_OUT_LINES))
$(OBJDIR)/.mozconfig.mk: $(TOPSRCDIR)/client.mk $(FOUND_MOZCONFIG) $(call mkdir_deps,$(OBJDIR)) $(OBJDIR)/CLOBBER
$(if $(MOZCONFIG_MK_LINES),( $(foreach line,$(MOZCONFIG_MK_LINES), echo '$(subst ||, ,$(line))';) )) > $@
ifdef MOZ_CURRENT_PROJECT
echo export MOZ_CURRENT_PROJECT=$(MOZ_CURRENT_PROJECT) >> $@
endif
# Include that makefile so that it is created. This should not actually change
# the environment since MOZCONFIG_CONTENT, which MOZCONFIG_OUT_LINES derives
......
......@@ -41,6 +41,7 @@ class TestMozbuildObject(unittest.TestCase):
self._old_env = dict(os.environ)
os.environ.pop('MOZCONFIG', None)
os.environ.pop('MOZ_OBJDIR', None)
os.environ.pop('MOZ_CURRENT_PROJECT', None)
def tearDown(self):
os.chdir(self._old_cwd)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment