mach build fails with syntax error
Categories
(Firefox Build System :: General, defect)
Tracking
(Not tracked)
People
(Reporter: marmanasu, Unassigned)
Details
Attachments
(1 file)
|
22.97 KB,
text/plain
|
Details |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/114.0
Steps to reproduce:
Follow the instructions in the Building Firefox on Windows article (https://firefox-source-docs.mozilla.org/setup/windows_build.html)
Actual results:
Attempting to run ./mach build fails with the following error messages:
make6944-2.sh: line 1: syntax error near unexpected token (' make6944-2.sh: line 1: C:\Program Files (x86)\GnuWin32\bin -C C:/mozilla-source/mozilla-unified/obj-x86_64-pc-windows-msvc '
mozmake: *** [client.mk:60: build] Error 2
The error appears to result from the space in the filepath for the GnuWin32 installation, but reinstalling GnuWin32 to a filepath which does not contain whitespace yields the same error. Reinstalling MozillaBuild and re-bootstrapping did not change the displayed filepath to the actual install location of GnuWin32 - it seems that the default install location is assumed, even though that filepath causes a syntax error.
Expected results:
The build should finish successfully.
Comment 1•2 years ago
|
||
Can you attach the complete output of ./mach build after you remove obj-x86_64-pc-windows-msvc?
| Reporter | ||
Comment 2•2 years ago
|
||
Comment 3•2 years ago
|
||
Can you apply this patch:
diff --git a/client.mk b/client.mk
index 04fe5161ed87e..90e99aae71312 100644
--- a/client.mk
+++ b/client.mk
@@ -30,6 +30,8 @@ MOZ_MAKE_FLAGS += --output-sync=line
endif
endif
+$(info MAKE = $(MAKE))
+$(info MOZ_MAKE_FLAGS = $(MOZ_MAKE_FLAGS))
MOZ_MAKE = $(MAKE) $(MOZ_MAKE_FLAGS) -C $(OBJDIR)
ifdef MOZBUILD_MANAGE_SCCACHE_DAEMON
Run ./mach build again and paste its output?
| Reporter | ||
Comment 4•2 years ago
|
||
Apologies for the delay, after applying that patch I get the following output:
$ ./mach build
0:01.81 W Clobber not needed.
0:03.29 W Adding make options from None
MOZ_OBJDIR=C:/mozilla-source/mozilla-unified/obj-x86_64-pc-windows-msvc
OBJDIR=C:/mozilla-source/mozilla-unified/obj-x86_64-pc-windows-msvc
Parallelism determined by memory: using 12 jobs for 12 cores based on 15.9 GiB RAM and estimated job size of 1.0 GiB
0:03.30 C:/Users/Who/.mozbuild/mozmake/mozmake.exe -f client.mk -j12 -s
0:03.32 MAKE = C:/Programs/GnuWin32/bin
0:03.32 MOZ_MAKE_FLAGS =
0:03.43 process_begin: CreateProcess(NULL, C:/Programs/GnuWin32/bin -C C:/mozilla-source/mozilla-unified/obj-x86_64-pc-windows-msvc, ...) failed.
0:03.44 make (e=5): Access is denied.
0:03.44 mozmake: *** [client.mk:62: build] Error 5
0:03.44 W 0 compiler warnings present.
Comment 5•2 years ago
|
||
Can you try running C:/Users/Who/.mozbuild/mozmake/mozmake.exe -f client.mk -j12 -s instead of ./mach build?
| Reporter | ||
Comment 6•2 years ago
|
||
Output:
$ C:/Users/Who/.mozbuild/mozmake/mozmake.exe -f client.mk -j12 -s
client.mk:19: *** client.mk must be used via `mach`. Try running `./mach `. Stop.
Comment 7•2 years ago
|
||
Can you try again with C:/Users/Who/.mozbuild/mozmake/mozmake.exe -f client.mk -j12 -s MACH=1?
| Reporter | ||
Comment 8•2 years ago
|
||
Output:
$ C:/Users/Who/.mozbuild/mozmake/mozmake.exe -f client.mk -j12 -s MACH=1
MAKE = C:/Users/Who/.mozbuild/mozmake/mozmake.exe
MOZ_MAKE_FLAGS =
client.mk:24: /.mozconfig-client-mk: No such file or directory
mozmake: *** No rule to make target '/.mozconfig-client-mk'. Stop.
Comment 9•2 years ago
|
||
Where the hell does the difference in MAKE between comment 4 and comment 8 come from?
Does applying this patch fix it?
diff --git a/python/mozbuild/mozbuild/base.py b/python/mozbuild/mozbuild/base.py
index 8dc9f90dbf641..b0fa7cabfb985 100644
--- a/python/mozbuild/mozbuild/base.py
+++ b/python/mozbuild/mozbuild/base.py
@@ -784,6 +784,7 @@ class MozbuildObject(ProcessExecutionMixin):
append_env = dict(append_env or ())
append_env["MACH"] = "1"
+ append_env["MAKE"] = self.substs["GMAKE"]
params = {
"args": args,
| Reporter | ||
Comment 10•2 years ago
|
||
That patch fixed it, it now builds successfully! I have no idea why MAKE is different now, the change persisted after your last patch but doesn't seem to have prevented the build from finishing.
| Reporter | ||
Updated•2 years ago
|
Description
•