Skip to content

Commit

Permalink
mach: Fail properly if we can't find the path for OSMesa or GLAPI.
Browse files Browse the repository at this point in the history
Currently we check `if not (osmesa_path and glapi_path)` after using
`path.join`. It seems we actually want to check whether
`find_dep_path_newest` returns something, because if calls to that
function fail, we'll instead get an error from `path.join` about
`NoneType` not having attribute `endswith` (it expects a string), which
preempts this check.
  • Loading branch information
jyc committed Jun 22, 2017
1 parent b9d66df commit 260c41a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions python/servo/command_base.py
Expand Up @@ -189,12 +189,13 @@ def set_osmesa_env(bin_path, env):
env["LD_LIBRARY_PATH"] = osmesa_path
env["GALLIUM_DRIVER"] = "softpipe"
elif is_macosx():
osmesa_path = path.join(find_dep_path_newest('osmesa-src', bin_path),
osmesa_dep_path = find_dep_path_newest('osmesa-src', bin_path)
if not osmesa_dep_path:
return None
osmesa_path = path.join(osmesa_dep_path,
"out", "src", "gallium", "targets", "osmesa", ".libs")
glapi_path = path.join(find_dep_path_newest('osmesa-src', bin_path),
glapi_path = path.join(osmesa_dep_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
Expand Down

0 comments on commit 260c41a

Please sign in to comment.