Closed Bug 1234439 Opened 9 years ago Closed 8 years ago

./mach build faster broken on Windows

Categories

(Firefox Build System :: Mach Core, enhancement)

Unspecified
Windows 7
enhancement
Not set
normal

Tracking

(firefox46 fixed)

RESOLVED FIXED
mozilla46
Tracking Status
firefox46 --- fixed

People

(Reporter: markh, Assigned: glandium)

References

Details

Attachments

(5 files)

Since I updated yesterday I see:

> $ ./mach build faster
> 0:01.56 c:\mozilla-build\mozmake\mozmake.EXE -C o:/src/mozilla-git/gecko-dev/obj-release -j12 -s backend.RecursiveMakeBackend
> 0:01.89 c:\mozilla-build\mozmake\mozmake.EXE -C faster -j12 -s
> 0:06.17 C:/Users/skip/AppData/Local/Temp/make8268-8.sh: line 3: unexpected EOF while looking for matching `"'
> 0:06.18 C:/Users/skip/AppData/Local/Temp/make8268-8.sh: line 4: syntax error: unexpected end of file
> 0:06.18 o:/src/mozilla-git/gecko-dev/config/faster/rules.mk:126: recipe for target 'o:/src/mozilla-git/gecko-dev/obj-release/dist/bin/browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/chrome.manifest' failed
> 0:06.18 mozmake.EXE: *** [o:/src/mozilla-git/gecko-dev/obj-release/dist/bin/browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/chrome.manifest] Error 258
> 0:06.18 mozmake.EXE: *** Waiting for unfinished jobs....

Specifying a directory to build works OK. The make*.sh file is removed after the above is printed so I can't tell you what that file contains.
Try pasting the output from `mach build faster -v`
Nothing obvious I can see, but I'm not sure what I'm looking for :)
Please try this:

diff --git a/python/mozbuild/mozbuild/backend/fastermake.py b/python/mozbuild/mozbuild/backend/fastermake.py
index 78c80f4..342fc26 100644
--- a/python/mozbuild/mozbuild/backend/fastermake.py
+++ b/python/mozbuild/mozbuild/backend/fastermake.py
@@ -239,17 +239,17 @@ class FasterMakeBackend(CommonBackend):
 
         # Add information for chrome manifest generation
         manifest_targets = []
 
         for target, entries in self._manifest_entries.iteritems():
             manifest_targets.append(target)
             target = '$(TOPOBJDIR)/%s' % target
             mk.create_rule([target]).add_dependencies(
-                ['content = %s' % ' '.join('"%s"' % e for e in entries)])
+                ['content = %s' % ' '.join("'%s'" % e for e in entries)])
 
         mk.add_statement('MANIFEST_TARGETS = %s' % ' '.join(manifest_targets))
 
         # Add information for install manifests.
         mk.add_statement('INSTALL_MANIFESTS = %s'
                          % ' '.join(self._install_manifests.keys()))
 
         # Add dependencies we infered:
(In reply to Mike Hommey [:glandium] from comment #3)
> Please try this:

That doesn't fix the issue for me :( Best I can tell, that code isn't hit before the error throws. I made some futile attempts to inspect that temp .sh before it vanished but failed - if you can tell me where it is written I can probably arrange to see the contents.
Try this, with and without the patch from comment 3, and please tell me which combinations work if any works:

diff --git a/config/faster/rules.mk b/config/faster/rules.mk
index cf665a6..af634da 100644
--- a/config/faster/rules.mk
+++ b/config/faster/rules.mk
@@ -119,17 +119,17 @@ $(addprefix install-,$(INSTALL_MANIFESTS)): install-%: $(TOPOBJDIR)/config/build
 #
 # The list of chrome manifests is given in MANIFEST_TARGETS, relative to the
 # top object directory. The content for those manifests is given in the
 # `content` variable associated with the target. For example:
 #   MANIFEST_TARGETS = foo
 #   $(TOPOBJDIR)/foo: content = "manifest foo.manifest" "manifest bar.manifest"
 $(addprefix $(TOPOBJDIR)/,$(MANIFEST_TARGETS)): FORCE
        $(PYTHON) -m mozbuild.action.buildlist \
-               $@ \
+               '$@' \
                $(content)
 
 # ============================================================================
 # Below is a set of additional dependencies and variables used to build things
 # that are not supported by data in moz.build.
 
 # Files to build with the recursive backend and simply copy
 $(TOPOBJDIR)/dist/bin/platform.ini: $(TOPOBJDIR)/toolkit/xre/platform.ini
Attachment #8701006 - Attachment mime type: text/x-patch → text/plain
(In reply to Mike Hommey [:glandium] from comment #5)
> Try this, with and without the patch from comment 3, and please tell me
> which combinations work if any works:

I responded on IRC, but for completeness, no combination worked.
Okay, found the root cause, which is that we're not quoting things in faster/Makefile, and bug 1191230 added things that break without quoting.
This will be used for chrome manifests in the faster make backend.
Assignee: nobody → mh+mozilla
Attachment #8701360 - Flags: review?(gps)
Bug 1191230 added override lines with # characters to chrome manifests
for Windows.

So far, chrome manifests were handled with buildlist.py like in the
RecursiveMake backend, fed with Make variables. Without proper quoting,
those Make variables are just truncated by Make on the first # character,
and this results in mach build faster failing because of that.

However, the reason why chrome manifests were handled with buildlist.py
originally is that not all chrome manifest entries were known to the
FasterMake backend, but they now all are.

So instead of relying on Make variables and buildlist.py, we can now
rely on the newly added install manifests feature allowing to create files
with a given content.
Attachment #8701361 - Flags: review?(gps)
Also add the corner case that broke mach build faster on Windows in bug 1191230.
Attachment #8701362 - Flags: review?(gps)
Blocks: 1191230
Comment on attachment 8701360 [details] [diff] [review]
Add support for files with a given content to install manifests

Review of attachment 8701360 [details] [diff] [review]:
-----------------------------------------------------------------

We should just put the whole source tree in install manifests :P
Attachment #8701360 - Flags: review?(gps) → review+
Attachment #8701361 - Flags: review?(gps) → review+
Attachment #8701362 - Flags: review?(gps) → review+
I wonder does adding '#XXX' in jar.mn really works? Shouldn't only the part before '#' involve in target locating?
(In reply to Xidorn Quan [:xidorn] (UTC+10) from comment #13)
> I wonder does adding '#XXX' in jar.mn really works? Shouldn't only the part
> before '#' involve in target locating?

cf. bug 1232421 comment 5
Depends on: 1240657
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: