Closed Bug 1275419 Opened 8 years ago Closed 8 years ago

Allow disabling VisualStudio backend

Categories

(Firefox Build System :: General, defect)

defect
Not set
normal

Tracking

(firefox49 fixed)

RESOLVED FIXED
mozilla49
Tracking Status
firefox49 --- fixed

People

(Reporter: gps, Assigned: glandium)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Follow-up from bug 1275297. Apparently glandium is going to hijack and scope bloat this bug. So I'll keep the description terse :)
Here's what I had in mind: support multi-value options with +/-. We have a few of those, like --enable-extensions or --enable-necko-protocols. --enable-build-backend shouldn't be treated differently.

So the core of it is that the option() has defaults and choices, and you can pass "absolute" values or "relative" values.
That is:

with:
  option('--enable-foo', default=('b', 'c'), choices=('a', 'b', 'c', 'd'))

you can pass:

--enable-foo -> results in ('b', 'c')
--enable-foo=a -> ('a',)
--enable-foo=a,b -> ('a', 'b')

(so far, that's the current behavior)

--enable-foo=+d -> ('b', 'c', 'd')
--enable-foo=-b -> ('c',)
--enable-foo=-b,+d -> ('c', 'd')
--enable-build-backend was taking a list of additional backends to add
to the defaults. Changes to allow to disable some of the defaults is not
possible in a straightforward way, so introduce a new
--build-backends option that sets the exact set of wanted backends,
but also allows to add and remove from the defaults with + or -.

--build-backends=+CompileDB is equivalent to
--enable-build-backend=CompileDB.

--build-backends=-VisualStudio disables the VS backend when it's
automatically enabled.

Review commit: https://reviewboard.mozilla.org/r/55036/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/55036/
Comment on attachment 8756215 [details]
MozReview Request: Bug 1275419 - Add support for the --option=+a,-b kind of options in python configure. r?chmanchester

https://reviewboard.mozilla.org/r/55034/#review52042

::: python/mozbuild/mozbuild/test/configure/test_options.py:254
(Diff revision 1)
> +        self.assertEquals(PositiveOptionValue(('c',)), value)
> +
> +        value = option.get_value('--with-option=-b,+d')
> +        self.assertEquals(PositiveOptionValue(('c','d')), value)
> +
> +        # Adding something that is int the default is fine

s/int/in/
Attachment #8756215 - Flags: review?(cmanchester) → review+
Comment on attachment 8756216 [details]
MozReview Request: Bug 1275419 - Deprecate --enable-build-backend and add --build-backends. r?chmanchester

https://reviewboard.mozilla.org/r/55036/#review52052
Attachment #8756216 - Flags: review?(cmanchester) → review+
(In reply to Mike Hommey [:glandium] from comment #1)
> Here's what I had in mind: support multi-value options with +/-. We have a
> few of those, like --enable-extensions or --enable-necko-protocols.
> --enable-build-backend shouldn't be treated differently.

I just wanted to chime in and say that this is a great idea and I'm glad you implemented it. :) It was always awkward to work with these multi-value options. I remember back when I would use --enable-extensions to build random things, but it had a set of defaults that the Firefox build needed, you'd have to explicitly `--enable-extensions=the,defaults,your_value`.
Assignee: nobody → mh+mozilla
https://hg.mozilla.org/mozilla-central/rev/429f5a3ae4ba
https://hg.mozilla.org/mozilla-central/rev/27108dad917e
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
Blocks: 1296108
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: