forked from mirrors/gecko-dev
Backed out changeset f05729424f4d (bug 1765361) for mbu fails on test_lint.py. CLOSED TREE
This commit is contained in:
parent
ea773f7d3c
commit
aaaf27f5ab
1 changed files with 13 additions and 10 deletions
|
|
@ -186,16 +186,19 @@ class MozbuildObject(ProcessExecutionMixin):
|
|||
topsrcdir, topobjdir, mozconfig = load_mozinfo(mozinfo_path)
|
||||
break
|
||||
|
||||
if not topsrcdir:
|
||||
# See if we're running from a Python virtualenv that's inside an objdir.
|
||||
# sys.prefix would look like "$objdir/_virtualenvs/$virtualenv/".
|
||||
# Note that virtualenv-based objdir detection work for instrumented builds,
|
||||
# because they aren't created in the scoped "instrumentated" objdir.
|
||||
# However, working-directory-ancestor-based objdir resolution should fully
|
||||
# cover that case.
|
||||
mozinfo_path = os.path.join(sys.prefix, "..", "..", "mozinfo.json")
|
||||
if detect_virtualenv_mozinfo and os.path.isfile(mozinfo_path):
|
||||
topsrcdir, topobjdir, mozconfig = load_mozinfo(mozinfo_path)
|
||||
# We choose an arbitrary file as an indicator that this is a
|
||||
# srcdir. We go with ourself because why not!
|
||||
our_path = os.path.join(
|
||||
dir_path, "python", "mozbuild", "mozbuild", "base.py"
|
||||
)
|
||||
if os.path.isfile(our_path):
|
||||
topsrcdir = dir_path
|
||||
break
|
||||
|
||||
# See if we're running from a Python virtualenv that's inside an objdir.
|
||||
mozinfo_path = os.path.join(os.path.dirname(sys.prefix), "../mozinfo.json")
|
||||
if detect_virtualenv_mozinfo and os.path.isfile(mozinfo_path):
|
||||
topsrcdir, topobjdir, mozconfig = load_mozinfo(mozinfo_path)
|
||||
|
||||
if not topsrcdir:
|
||||
topsrcdir = os.path.abspath(
|
||||
|
|
|
|||
Loading…
Reference in a new issue