Closed Bug 747069 Opened 12 years ago Closed 12 years ago

package-name.mk: MOZ_SOURCE_REPO/shell optimizations

Categories

(Firefox Build System :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: joey, Assigned: joey)

Details

toolkit/mozapps/installer/package-name.mk:
==========================================
MOZ_SOURCE_REPO = $(shell $(MOZILLA_DIR) && hg showconfig paths.default)

This command should be wrapped by an $(if $(MOZILLA_DIR),$(shell ...)) test to prevent running hg showconfig from the users home directory when MOZILLA_DIR is undefined.  Unsure about frequency right now but if this is tied to 'make package' there may be a few stray shells that can be cleaned up.


Repo query logic could/should be more selective about where/how-often shell queries are made to gather the repo path.  Conditionals like the following exist in a few makefiles:

ifneq ($(NULL),$(SOURCE_REPO))
  DEFINES += $DMOZ_SOURCE_REPO="$(SOURCE_REPO)"
endif

Some were added to work around old hg versions that did not support 'showconfig'.  If any conditionals were added to work around missing values {or worse intermittent errors} make will be wasting cycles attempting to run shell commands that cannot succeed.


One option to try might be to base lookup on the existence of a revision control directory.  Overhead for $(wildcard $(srcdir)/.hg)/opendir/glob should be smaller than $(shell) + hg + processing.  When found export/cache the answer in memory for re-use by subdir processing.
Assignee: nobody → joey
A try build on linux reports status for source_repo lookups during "make package":
  o 53 calls succeeded: ans=http://hg.mozila.org/try 
  o 41 shells were spawned that returned no answer.

Check if the 41 calls are due to MOZILLA_DIR not being set and if so wrap them with an $(if) conditional to avoid wasting cycles.

Also determine why the calls are being made and if valid, why are they failing.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → WONTFIX
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.