Bug 1415335 - Move spaces in path check to configure; r=nalexander
authorGregory Szorc <gps@mozilla.com>
Mon, 30 Oct 2017 16:35:04 -0700
changeset 390644 9fd30a79e468d8fffe922ace03a8533b17c0978b
parent 390643 1557f5e4e889f4f8cec8f598e42dd3e8c6d94cf6
child 390645 3894f3262cbcbf35bed76f691a3ab764f2b9cce3
push id32838
push usernbeleuzu@mozilla.com
push dateWed, 08 Nov 2017 10:46:55 +0000
treeherdermozilla-central@3e95c596ad5b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs1415335
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1415335 - Move spaces in path check to configure; r=nalexander Checks like this are what configure is for. In addition to moving the check, we also validate topobjdir as well. MozReview-Commit-ID: 9sVNQJsAnjO
build/moz.configure/init.configure
client.mk
--- a/build/moz.configure/init.configure
+++ b/build/moz.configure/init.configure
@@ -29,16 +29,31 @@ def check_build_environment(help, dist):
         topsrcdir=topsrcdir,
         topobjdir=topobjdir,
         dist=dist,
     )
 
     if help:
         return result
 
+    # This limitation has mostly to do with GNU make. Since make can't represent
+    # variables with spaces without correct quoting and many paths are used
+    # without proper quoting, using paths with spaces commonly results in
+    # targets or dependencies being treated as multiple paths. This, of course,
+    # undermines the ability for make to perform up-to-date checks and makes
+    # the build system not work very efficiently. In theory, a non-make build
+    # backend will make this limitation go away. But there is likely a long tail
+    # of things that will need fixing due to e.g. lack of proper path quoting.
+    if len(topsrcdir.split()) > 1:
+        die('Source directory cannot be located in a path with spaces: %s' %
+            topsrcdir)
+    if len(topobjdir.split()) > 1:
+        die('Object directory cannot be located in a path with spaces: %s' %
+            topobjdir)
+
     if topsrcdir == topobjdir:
         die('  ***\n'
             '  * Building directly in the main source directory is not allowed.\n'
             '  *\n'
             '  * To build, you must run configure from a separate directory\n'
             '  * (referred to as an object directory).\n'
             '  *\n'
             '  * If you are building with a mozconfig, you will need to change your\n'
--- a/client.mk
+++ b/client.mk
@@ -26,19 +26,16 @@ define BUILDSTATUS
 @echo 'BUILDSTATUS $1'
 
 endef
 endif
 endif
 
 
 CWD := $(CURDIR)
-ifneq (1,$(words $(CWD)))
-$(error The mozilla directory cannot be located in a path with spaces.)
-endif
 
 ifeq "$(CWD)" "/"
 CWD   := /.
 endif
 
 ifndef TOPSRCDIR
 ifeq (,$(wildcard client.mk))
 TOPSRCDIR := $(patsubst %/,%,$(dir $(MAKEFILE_LIST)))