Skip to content

Commit 7d7d03d

Browse files
committedNov 2, 2022
Bug 1798779 - Stop using double-colon rules in client.mk. r=firefox-build-system-reviewers,nalexander
Since bug 1784179, we make `make` keep going after errors. When an error happens, `make` stops rules at the command that fails, but if there are multiple double-colon rules for the same target, it still runs the remaining rules, which has undesirable side effects in client.mk: it stops an already stopped sccache, which leaves an error in the log. Differential Revision: https://phabricator.services.mozilla.com/D161083
1 parent 19823d5 commit 7d7d03d

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed
 

‎client.mk

+4-11
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,8 @@ endif
3232

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

35-
### Rules
36-
# The default rule is build
37-
build::
38-
3935
# In automation, manage an sccache daemon. The starting of the server
4036
# needs to be in a make file so sccache inherits the jobserver.
41-
ifdef MOZBUILD_MANAGE_SCCACHE_DAEMON
4237
SCCACHE_STOP = $(MOZBUILD_MANAGE_SCCACHE_DAEMON) --stop-server
4338

4439
# When a command fails, make is going to abort, but we need to terminate the
@@ -48,7 +43,9 @@ SCCACHE_STOP = $(MOZBUILD_MANAGE_SCCACHE_DAEMON) --stop-server
4843
# gymnastics.
4944
SCCACHE_STOP_ON_FAILURE = || (x=$$?; $(SCCACHE_STOP) || true; exit $$x)
5045

51-
build::
46+
# The default rule is build
47+
build:
48+
ifdef MOZBUILD_MANAGE_SCCACHE_DAEMON
5249
# Terminate any sccache server that might still be around.
5350
-$(SCCACHE_STOP) > /dev/null 2>&1
5451
# Start a new server, ensuring it gets the jobserver file descriptors
@@ -57,16 +54,12 @@ build::
5754
mkdir -p $(UPLOAD_PATH)
5855
$(if $(findstring n,$(filter-out --%, $(MAKEFLAGS))),,+)env SCCACHE_LOG=sccache=debug SCCACHE_ERROR_LOG=$(UPLOAD_PATH)/sccache.log $(MOZBUILD_MANAGE_SCCACHE_DAEMON) --start-server
5956
endif
60-
61-
### Build it
62-
build::
57+
### Build it
6358
+$(MOZ_MAKE) $(SCCACHE_STOP_ON_FAILURE)
6459
ifdef MOZ_AUTOMATION
6560
+$(MOZ_MAKE) automation/build $(SCCACHE_STOP_ON_FAILURE)
6661
endif
67-
6862
ifdef MOZBUILD_MANAGE_SCCACHE_DAEMON
69-
build::
7063
# Terminate sccache server. This prints sccache stats.
7164
-$(SCCACHE_STOP)
7265
endif

0 commit comments

Comments
 (0)
Failed to load comments.