Add lazy-lookup for static files and help for static packaging failures.
Review Request #8418 — Created Sept. 19, 2016 and submitted — Latest diff uploaded
We had a regression when packaging Review Board extensions that was
traced to the use ofstatic()
in a class definition. This ended up
initializing some static media support before the extension packaging
code could set some state.There's now some helpful output for this type of failure that gives the
caller some info on what may have gone wrong and how to remedy it. It
includes a reference to a new method,static_lazy()
.
static_lazy()
works likestatic()
, but lazily evaluates when needed,
instead of immediately. This is safe to use in class definitions, global
variables, etc., and helps prevent the kind of regression we hit.
Tested the failure case and saw the more useful error output.
Switched code to use
static_lazy()
, and the problem went away.