package-name.mk: MOZ_SOURCE_REPO/shell optimizations

RESOLVED WONTFIX

Status

()

Core
Build Config
RESOLVED WONTFIX
6 years ago
6 years ago

People

(Reporter: joey, Assigned: joey)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Assignee)

Description

6 years ago
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)

Updated

6 years ago
Assignee: nobody → joey
(Assignee)

Comment 1

6 years ago
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.
(Assignee)

Updated

6 years ago
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.