Run Visual Studio backend automatically

RESOLVED FIXED in Firefox 49

Status

defect
RESOLVED FIXED
3 years ago
Last year

People

(Reporter: gps, Assigned: gps)

Tracking

unspecified
mozilla49
Dependency tree / graph

Firefox Tracking Flags

(firefox49 fixed)

Details

Attachments

(4 attachments)

Assignee

Description

3 years ago
We only need to do a few things to enable the Visual Studio project files to be generated automatically. Let's do that.
Assignee

Comment 1

3 years ago
Upon further examination, VS2013 and VS2015 share the same file format
version. They also write the internal version number in a comment, not
the user-facing production version.

Review commit: https://reviewboard.mozilla.org/r/54874/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/54874/
Attachment #8755902 - Flags: review?(cmanchester)
Attachment #8755903 - Flags: review?(cmanchester)
Attachment #8755904 - Flags: review?(cmanchester)
Attachment #8755905 - Flags: review?(mh+mozilla)
Assignee

Comment 2

3 years ago
Visual Studio will write this variable to an ancient Visual Studio
version (2010 I believe) if we don't specify it. Explicitly write the
variable to the minimum Visual Studio version we support.

Review commit: https://reviewboard.mozilla.org/r/54876/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/54876/
Assignee

Comment 3

3 years ago
There is probably a way to dynamically retrieve the version. But rather
than take the chance we'd query the wrong thing, let's just parse the
version that Visual Studio writes to the solution file when saving it and
use it.

With this change, generating the VisualStudio build backend should not change
any files unless the build config has changed. This means we can generate
Visual Studio files at will without causing Visual Studio to complain
about the solution and other files changing and needing reloading.

Review commit: https://reviewboard.mozilla.org/r/54878/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/54878/
Assignee

Comment 4

3 years ago
Now that the VisualStudio backend will no-op if nothing has changed, it
should be safe to always run this backend.

On first run, backend generation takes ~3.5s on my machine. On subsequent run,
it takes ~1.5s. Wall time for a no-op config.status is now ~15.7s. We could like
make the Visual Studio backend faster by not writing so many project files.
But this would require consolidating libraries in moz.build files. And that's
out of scope for this change.

Review commit: https://reviewboard.mozilla.org/r/54880/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/54880/
Will there be an option to NOT TO generate stuff automatically?  I use my own solution.
Assignee

Comment 6

3 years ago
You can put your solution in a separate directory. Or we can add an explicit configure flag to enable/disable the generation. (I have a feeling glandium may push back on this patch because I didn't make the backend conditional. I'm not sure how all this new configure stuff works, which is why I asked him for the review.)

Long term, I'd like to know why your solution is better than what we generate and have the built-in solution generation improve to accommodate your needs. Please file a bug describing the advantages of your approach so we can have a discussion.
(In reply to Gregory Szorc [:gps] from comment #6)
> You can put your solution in a separate directory.

That's the last thing I want to do, sorry.

> Or we can add an explicit
> configure flag to enable/disable the generation. 

Please do.

> (I have a feeling glandium
> may push back on this patch because I didn't make the backend conditional.
> I'm not sure how all this new configure stuff works, which is why I asked
> him for the review.)
> 
> Long term, I'd like to know why your solution is better than what we
> generate and have the built-in solution generation improve to accommodate
> your needs. Please file a bug describing the advantages of your approach so
> we can have a discussion.

I'm used to it for long years - strongest reason, have only included modules which I work with (each one is a separate project, so that solution explorer nicely copies native moz src dir structs, can build just a single module easily), have more run configs (release/debug/?), can build binaries from IDE to get errors.  But also has drawbacks, like constantly creating temp dirs in the tree, have to sync when files are added/removed manually (crazy, that IDE doesn't do it for me)  

I never tried the generated solution honestly.  Anyway, I think making this feature optional is something you really should do...
Comment on attachment 8755902 [details]
MozReview Request: Bug 1275297 - Use proper header in solution file; r?chmanchester

https://reviewboard.mozilla.org/r/54874/#review51582
Attachment #8755902 - Flags: review?(cmanchester) → review+
Comment on attachment 8755903 [details]
MozReview Request: Bug 1275297 - Write MinimumVisualStudioVersion to solution file; r?chmanchester

https://reviewboard.mozilla.org/r/54876/#review51584
Attachment #8755903 - Flags: review?(cmanchester) → review+
Comment on attachment 8755904 [details]
MozReview Request: Bug 1275297 - Write VisualStudioVersion to solution file; r?chmanchester

https://reviewboard.mozilla.org/r/54878/#review51590
Attachment #8755904 - Flags: review?(cmanchester) → review+
Comment on attachment 8755905 [details]
MozReview Request: Bug 1275297 - Create Visual Studio project files by default on Windows; r?glandium

https://reviewboard.mozilla.org/r/54880/#review51620

Please file a followup to allow disabling it (and I'll hijack it with a broader scope)
Attachment #8755905 - Flags: review?(mh+mozilla) → review+
Assignee

Updated

3 years ago
Blocks: 1275419
Assignee

Comment 15

3 years ago
glandium IRC reviewed those last 2 commits (technically a new commit and a fixup for another commit). He said I should file a follow-up to disable VisualStudio generation if we're doing a non-MSVC build. However, I /think/ the VS files may still be valid for non-MSVC builds. I'm not sure if IntelliSense will work. But all the #defines and build targets should still shell out correctly. Since non-MSVC builds are currently rare, I say we ignore the follow-up for now and add it if people ask for it.

Updated

Last year
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.