aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/command_base.py
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-12-15 07:42:30 -0800
committerGitHub <noreply@github.com>2016-12-15 07:42:30 -0800
commit44af5ea2e4ccb77f55dea5492408ebfcdeb73250 (patch)
tree162b175eb06f1bc398b61b78bc2efa7a63943974 /python/servo/command_base.py
parentd6788a5048b9aeab592de651edb2513816389a48 (diff)
parent000d46490e0d964d3ace93e7dac6b4ceaf27cc33 (diff)
downloadservo-44af5ea2e4ccb77f55dea5492408ebfcdeb73250.tar.gz
servo-44af5ea2e4ccb77f55dea5492408ebfcdeb73250.zip
Auto merge of #14601 - Wafflespeanut:osmesa, r=emilio
Raise warning when OSMesa path is not set In Ubuntu 14.04, I still get crashes due to non-existence of OsMesa library (#13515). It turned out that sometimes I have paths like `osmesa-src-<hash>` without `out/lib/gallium`. Now, we raise a warning whenever we don't find a proper path. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Either: --> - [x] These changes do not require tests because it's related to mach. <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14601) <!-- Reviewable:end -->
Diffstat (limited to 'python/servo/command_base.py')
-rw-r--r--python/servo/command_base.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/python/servo/command_base.py b/python/servo/command_base.py
index 949ffbc0355..b0f62e65061 100644
--- a/python/servo/command_base.py
+++ b/python/servo/command_base.py
@@ -54,13 +54,10 @@ def find_dep_path_newest(package, bin_path):
with cd(deps_path):
for c in glob(package + '-*'):
candidate_path = path.join(deps_path, c)
- candidate_output = path.join(candidate_path, "output")
- if path.exists(candidate_output):
- candidates.append((path.getmtime(candidate_output), candidate_path))
- candidates.sort(reverse=True)
+ if path.exists(path.join(candidate_path, "output")):
+ candidates.append(candidate_path)
if candidates:
- _, candidate_path = candidates[0]
- return candidate_path
+ return max(candidates, key=lambda c: path.getmtime(path.join(c, "output")))
return None
@@ -221,7 +218,10 @@ def is_linux():
def set_osmesa_env(bin_path, env):
"""Set proper LD_LIBRARY_PATH and DRIVE for software rendering on Linux and OSX"""
if is_linux():
- osmesa_path = path.join(find_dep_path_newest('osmesa-src', bin_path), "out", "lib", "gallium")
+ dep_path = find_dep_path_newest('osmesa-src', bin_path)
+ if not dep_path:
+ return None
+ osmesa_path = path.join(dep_path, "out", "lib", "gallium")
env["LD_LIBRARY_PATH"] = osmesa_path
env["GALLIUM_DRIVER"] = "softpipe"
elif is_macosx():
@@ -229,6 +229,8 @@ def set_osmesa_env(bin_path, env):
"out", "src", "gallium", "targets", "osmesa", ".libs")
glapi_path = path.join(find_dep_path_newest('osmesa-src', bin_path),
"out", "src", "mapi", "shared-glapi", ".libs")
+ if not (osmesa_path and glapi_path):
+ return None
env["DYLD_LIBRARY_PATH"] = osmesa_path + ":" + glapi_path
env["GALLIUM_DRIVER"] = "softpipe"
return env