Closed
Bug 1520718
Opened 5 years ago
Closed 5 years ago
In python configure, the when of a when is ignored
Categories
(Firefox Build System :: General, defect)
Firefox Build System
General
Tracking
(firefox66 fixed)
RESOLVED
FIXED
mozilla66
Tracking | Status | |
---|---|---|
firefox66 | --- | fixed |
People
(Reporter: glandium, Assigned: glandium)
References
Details
Attachments
(1 file)
option('--with-foo', help='foo')
option('--without-bar', help='bar', when='--with-foo')
set_config('BAR', True, when='--with-bar')
makes BAR set to True, which doesn't make sense.
Now, come to think of it, the equivalent, using a depends function, is actually forbidden:
option('--with-foo', help='foo')
option('--without-bar', help='bar', when='--with-foo')
@depends('--with-bar')
def bar(value):
return value
set_config('BAR', True, when=bar)
saying that the @depends function needs the same when
as the option it depends on. And it would make sense that the same restriction applies.
Assignee | ||
Comment 1•5 years ago
|
||
Actually, the equivalent would be
option('--with-foo', help='foo')
option('--without-bar', help='bar', when='--with-foo')
@depends('--with-bar', when='--with-foo')
def bar(value):
return value
set_config('BAR', True, when=bar)
And not only is it accepted, but it doesn't do the same thing: BAR is not set.
Assignee | ||
Comment 2•5 years ago
|
||
In fact, set_config
doesn't even need to be involved:
option('--with-foo', help='foo')
option('--without-bar', help='bar', when='--with-foo')
option('--with-qux', help='qux', when='--with-bar')
Has the same problem.
Assignee | ||
Comment 3•5 years ago
|
||
Make option(..., when='--foo') equivalent to option(..., when=depends('--foo')(lambda x: x)).
Pushed by mh@glandium.org: https://hg.mozilla.org/integration/autoland/rev/6f0ec77a2d7e In python configure, fix `when` in `option`. r=nalexander
Comment 5•5 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 5 years ago
status-firefox66:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
You need to log in
before you can comment on or make changes to this bug.
Description
•