Skip to content

Commit

Permalink
Backed out changeset b3654ee48ff4 (bug 1683797) for causing frequent …
Browse files Browse the repository at this point in the history
…build timeouts as bug 1411358. CLOSED TREE
  • Loading branch information
CosminSabou committed Jan 29, 2021
1 parent 7d36691 commit 0d128eb
Showing 1 changed file with 42 additions and 7 deletions.
49 changes: 42 additions & 7 deletions client.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,42 @@
# MOZ_MAKE_FLAGS - Flags to pass to $(MAKE)
#
#######################################################################
# Defines

ifndef MACH
$(error client.mk must be used via `mach`. Try running \
`./mach $(firstword $(MAKECMDGOALS) $(.DEFAULT_GOAL))`)
ifdef MACH
ifndef NO_BUILDSTATUS_MESSAGES
define BUILDSTATUS
@echo 'BUILDSTATUS $1'

endef
endif
endif


CWD := $(CURDIR)

ifeq "$(CWD)" "/"
CWD := /.
endif

### Load mozconfig options
PYTHON3 ?= python3

####################################
# Load mozconfig Options

include $(OBJDIR)/.mozconfig-client-mk

### Set up make flags
ifdef MOZ_PARALLEL_BUILD
MOZ_MAKE_FLAGS := $(filter-out -j%,$(MOZ_MAKE_FLAGS))
MOZ_MAKE_FLAGS += -j$(MOZ_PARALLEL_BUILD)
endif

# Automatically add -jN to make flags if not defined. N defaults to number of cores.
ifeq (,$(findstring -j,$(MOZ_MAKE_FLAGS)))
cores=$(shell $(PYTHON3) -c 'import multiprocessing; print(multiprocessing.cpu_count())')
MOZ_MAKE_FLAGS += -j$(cores)
endif

ifdef MOZ_AUTOMATION
ifeq (4.0,$(firstword $(sort 4.0 $(MAKE_VERSION))))
MOZ_MAKE_FLAGS += --output-sync=line
Expand All @@ -32,10 +58,17 @@ endif

MOZ_MAKE = $(MAKE) $(MOZ_MAKE_FLAGS) -C $(OBJDIR)

### Rules
#######################################################################
# Rules

# The default rule is build
build::

ifndef MACH
$(error client.mk must be used via `mach`. Try running \
`./mach $(firstword $(MAKECMDGOALS) $(.DEFAULT_GOAL))`)
endif

# In automation, manage an sccache daemon. The starting of the server
# needs to be in a make file so sccache inherits the jobserver.
ifdef MOZBUILD_MANAGE_SCCACHE_DAEMON
Expand All @@ -49,7 +82,9 @@ build::
$(if $(findstring n,$(filter-out --%, $(MAKEFLAGS))),,+)env SCCACHE_LOG=sccache=debug SCCACHE_ERROR_LOG=$(UPLOAD_PATH)/sccache.log $(MOZBUILD_MANAGE_SCCACHE_DAEMON) --start-server
endif

### Build it
####################################
# Build it

build::
+$(MOZ_MAKE)

Expand Down

0 comments on commit 0d128eb

Please sign in to comment.