Closed
Bug 1122812
Opened 9 years ago
Closed 9 years ago
Change the visual studio project generator to add the Unified_foo_bar_baz0.cpp files to the project, and not the sources specified in UNIFIED_SOURCES
Categories
(Firefox Build System :: General, defect)
Tracking
(firefox38 fixed)
RESOLVED
FIXED
mozilla38
Tracking | Status | |
---|---|---|
firefox38 | --- | fixed |
People
(Reporter: ehsan.akhgari, Assigned: froydnj)
References
(Blocks 1 open bug)
Details
Attachments
(4 files, 2 obsolete files)
10.04 KB,
patch
|
mshal
:
review+
|
Details | Diff | Splinter Review |
1.86 KB,
patch
|
mshal
:
review+
|
Details | Diff | Splinter Review |
2.28 KB,
patch
|
mshal
:
review+
|
Details | Diff | Splinter Review |
5.74 KB,
patch
|
mshal
:
review+
|
Details | Diff | Splinter Review |
This should fix the issues with removing non-unified builds that people are reporting.
Assignee | ||
Comment 1•9 years ago
|
||
I will do this, I already have some patches written in my head.
Assignee: nobody → nfroyd
Reporter | ||
Comment 2•9 years ago
|
||
Thank you!
How will we handle changes that modify the number of generated cpp files?
Reporter | ||
Comment 4•9 years ago
|
||
(In reply to ben turner [:bent] (use the needinfo? flag!) from comment #3) > How will we handle changes that modify the number of generated cpp files? It won't. The project needs to be reconstructed in that case anyway, right?
Assignee | ||
Comment 5•9 years ago
|
||
UnifiedSources, not the recursivemake backend, should be responsible for figuring out what unified files to generate, and what those unified files should contain.
Attachment #8559988 -
Flags: review?(mshal)
Assignee | ||
Comment 6•9 years ago
|
||
UnifiedSources will be processed outside of consume_object, so we need some way of accessing the backend file for an object outside of consume_object as well.
Attachment #8559990 -
Flags: review?(mshal)
Assignee | ||
Comment 7•9 years ago
|
||
CommonBackend is where the writing of the unified files belong, since that's an operation common to all backends. A special hook into subclasses is used to enable subclass-specific processing of UnifiedSources.
Attachment #8559991 -
Flags: review?(mshal)
Assignee | ||
Comment 8•9 years ago
|
||
With the previous changes, we can now tell Visual Studio about the actual unified files, rather than the files that are #include'd in them. I believe this is much closer to what Visual Studio wants to see, and enables things like Intellisense to work properly.
Attachment #8559992 -
Flags: review?(mshal)
Assignee | ||
Comment 9•9 years ago
|
||
This series follows bug 1129635 comment 0's suggestion; I don't know if there's a better way to do it, but I couldn't figure out a pleasant way to do it within the constraints assumed by consume_object and the .ack() flag on a moz.build object.
Assignee | ||
Comment 10•9 years ago
|
||
With the previous changes, we can now tell Visual Studio about the actual unified files, rather than the files that are #include'd in them. I believe this is much closer to what Visual Studio wants to see, and enables things like Intellisense to work properly. This version of the patch actually ensures that Unified*.cpp files are written into the vcxproj files. The visualstudio backend doesn't follow the consume_object protocol (insofar as we have one...) and processes only the few frontend object types it's interested in, ack()'ing all the rest. This means that CommonBackend.consume_object never gets called, so the _process_unified_sources hook never gets called. What this also means is that building the Visual Studio backend on its own won't work without building the recursive make backend first. I don't think this is a problem currently, as many other things won't work with the Visual Studio backend (e.g. WebIDL/IPDL/XPIDL), but it's good to note it here for completeness.
Attachment #8559992 -
Attachment is obsolete: true
Attachment #8559992 -
Flags: review?(mshal)
Attachment #8561613 -
Flags: review?(mshal)
Updated•9 years ago
|
Attachment #8559988 -
Flags: review?(mshal) → review+
Updated•9 years ago
|
Attachment #8559990 -
Flags: review?(mshal) → review+
Comment 11•9 years ago
|
||
Comment on attachment 8559991 [details] [diff] [review] part 3 - move unified files writing for UnifiedSources to CommonBackend >diff --git a/python/mozbuild/mozbuild/backend/common.py b/python/mozbuild/mozbuild/backend/common.py >index 90e7189..992fd40 100644 >--- a/python/mozbuild/mozbuild/backend/common.py >+++ b/python/mozbuild/mozbuild/backend/common.py >+ elif isinstance(obj, UnifiedSources): >+ if obj.have_unified_mapping: >+ self._write_unified_files(obj.unified_source_mapping, obj.objdir) >diff --git a/python/mozbuild/mozbuild/backend/recursivemake.py b/python/mozbuild/mozbuild/backend/recursivemake.py >index ebb7038..e62775d 100644 >--- a/python/mozbuild/mozbuild/backend/recursivemake.py >+++ b/python/mozbuild/mozbuild/backend/recursivemake.py >+ if obj.have_unified_mapping: >+ self._write_unified_files(obj.unified_source_mapping, backend_file.objdir) Why are both recursivemake.py and common.py writing out the unified files? It looks like they both are trying to write out the same files when generating the make backend -- in an strace, I can see Unified_XYZ.cpp is opened twice - once to write the file and once to read it & compare, or opened for reading twice if it already exists. I think we would just want to do that in common.py, right?
Attachment #8559991 -
Flags: review?(mshal) → feedback+
Comment 12•9 years ago
|
||
Comment on attachment 8561613 [details] [diff] [review] part 4 - update the Visual Studio backend for UnifiedSources changes >diff --git a/python/mozbuild/mozbuild/backend/visualstudio.py b/python/mozbuild/mozbuild/backend/visualstudio.py >index 7f0cfac..69e3ffa 100644 >--- a/python/mozbuild/mozbuild/backend/visualstudio.py >+++ b/python/mozbuild/mozbuild/backend/visualstudio.py >@@ -105,17 +105,19 @@ class VisualStudioBackend(CommonBackend): > elif isinstance(obj, UnifiedSources): >- self._add_sources(reldir, obj) >+ # XXX we should be letting CommonBackend.consume_object call this >+ # for us instead. >+ self._process_unified_sources(obj); So why doesn't CommonBackend.consume_object work here?
Attachment #8561613 -
Flags: review?(mshal) → review+
Assignee | ||
Comment 13•9 years ago
|
||
CommonBackend is where the writing of the unified files belong, since that's an operation common to all backends. A special hook into subclasses is used to enable subclass-specific processing of UnifiedSources. Now with the _write_unified_files call removed from recursivemake.py.
Attachment #8559991 -
Attachment is obsolete: true
Attachment #8562816 -
Flags: review?(mshal)
Assignee | ||
Comment 14•9 years ago
|
||
(In reply to Michael Shal [:mshal] from comment #11) > Why are both recursivemake.py and common.py writing out the unified files? > It looks like they both are trying to write out the same files when > generating the make backend -- in an strace, I can see Unified_XYZ.cpp is > opened twice - once to write the file and once to read it & compare, or > opened for reading twice if it already exists. I think we would just want to > do that in common.py, right? Yeah, I just fail at moving the code out of recursivemake.py. New patch up. (In reply to Michael Shal [:mshal] from comment #12) > Comment on attachment 8561613 [details] [diff] [review] > part 4 - update the Visual Studio backend for UnifiedSources changes > > >diff --git a/python/mozbuild/mozbuild/backend/visualstudio.py b/python/mozbuild/mozbuild/backend/visualstudio.py > >index 7f0cfac..69e3ffa 100644 > >--- a/python/mozbuild/mozbuild/backend/visualstudio.py > >+++ b/python/mozbuild/mozbuild/backend/visualstudio.py > >@@ -105,17 +105,19 @@ class VisualStudioBackend(CommonBackend): > > elif isinstance(obj, UnifiedSources): > >- self._add_sources(reldir, obj) > >+ # XXX we should be letting CommonBackend.consume_object call this > >+ # for us instead. > >+ self._process_unified_sources(obj); > > So why doesn't CommonBackend.consume_object work here? Because visualstudio.py never calls CommonBackend.consume_object. I think this should be fixed, but it may also be part of a larger fix deciding how we want the common backend and sub-backends to work together.
Comment 15•9 years ago
|
||
Comment on attachment 8562816 [details] [diff] [review] part 3 - move unified files writing for UnifiedSources to CommonBackend Looks good to me!
Attachment #8562816 -
Flags: review?(mshal) → review+
Comment 16•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/308e00e6f6e8 https://hg.mozilla.org/mozilla-central/rev/65b27bd85568 https://hg.mozilla.org/mozilla-central/rev/732b88e667d0 https://hg.mozilla.org/mozilla-central/rev/b1da75458e00
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox38:
--- → fixed
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
Comment 17•9 years ago
|
||
This hurts my productivity greatly as it breaks intellisense. Can we back this out? At least until we can provide a command line option so that we can generate a project in which intellisense and all the other awesome code navigation things works?
Flags: needinfo?(nfroyd)
Assignee | ||
Comment 18•9 years ago
|
||
(In reply to Chris Pearce (:cpearce) from comment #17) > This hurts my productivity greatly as it breaks intellisense. > > Can we back this out? At least until we can provide a command line option so > that we can generate a project in which intellisense and all the other > awesome code navigation things works? Sorry, I meant to address this in bug 1138250 yesterday. I'll do that today.
Flags: needinfo?(nfroyd)
Updated•6 years ago
|
Product: Core → Firefox Build System
You need to log in
before you can comment on or make changes to this bug.
Description
•