Skip to content

Commit

Permalink
Bug 1278415 - Ensure MOZ_CURRENT_PROJECT is set when running make dir…
Browse files Browse the repository at this point in the history
…ectly 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.
  • Loading branch information
glandium committed Jun 16, 2016
1 parent 8a3b88f commit 721ada9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions client.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions python/mozbuild/mozbuild/test/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def setUp(self):
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)
Expand Down

0 comments on commit 721ada9

Please sign in to comment.