Closed Bug 1259354 Opened 4 years ago Closed 4 years ago

"checking yasm version" still written out when we actually don't do the check

Categories

(Firefox Build System :: General, defect)

defect
Not set

Tracking

(firefox48 fixed)

RESOLVED FIXED
mozilla48
Tracking Status
firefox48 --- fixed

People

(Reporter: glandium, Assigned: glandium)

References

(Depends on 1 open bug)

Details

Attachments

(1 file)

No description provided.
The reason the "checking" string always appears is that @depends
functions are always called, regardless of the value of the dependency.

This introduces a new decorator @depends_true, which works like
@depends, but the decorated function is not called unless one of the
dependency value resolves to True.

The new decorator can also be used to replace many cases where we do
@depends(foo)
def bar(foo):
    if foo:
        ...

Review commit: https://reviewboard.mozilla.org/r/42145/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/42145/
Attachment #8734255 - Flags: review?(ted)
Comment on attachment 8734255 [details]
MozReview Request: Bug 1259354 - Avoid "checking yasm version" being written out when yasm was not found. r?ted

https://reviewboard.mozilla.org/r/42145/#review38715

::: build/moz.configure/util.configure:138
(Diff revision 1)
> +
> +
> +# Like @depends, but the decorated function is only called if one of the
> +# arguments it would be called with has a positive value (bool(value) is True)
> +@template
> +def depends_true(*args):

Bikeshed: I think this might read more nicely as `depends_if`.
Attachment #8734255 - Flags: review?(ted) → review+
https://hg.mozilla.org/mozilla-central/rev/f7b4671d3a98
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.