Bug 1254913 - Handle symbolic links in the path leading to moz.configure draft
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 10 Mar 2016 15:49:14 +0900
changeset 338967 17a5da97a2603c599204d1cc254d84b2f865c8c5
parent 338940 e7a363b96695003a3d1d43fc373907c627908a1b
child 339112 3ad92c4569984056ffa401f322ce8bbdd195a2b5
push id12620
push userbmo:mh+mozilla@glandium.org
push dateThu, 10 Mar 2016 09:04:21 +0000
bugs1254913
milestone48.0a1
Bug 1254913 - Handle symbolic links in the path leading to moz.configure
python/mozbuild/mozbuild/configure/__init__.py
--- a/python/mozbuild/mozbuild/configure/__init__.py
+++ b/python/mozbuild/mozbuild/configure/__init__.py
@@ -154,17 +154,17 @@ class ConfigureSandbox(dict):
 
         if self._paths:
             path = mozpath.join(mozpath.dirname(self._paths[-1]), path)
             if not mozpath.basedir(path, (mozpath.dirname(self._paths[0]),)):
                 raise ConfigureError(
                     'Cannot include `%s` because it is not in a subdirectory '
                     'of `%s`' % (path, mozpath.dirname(self._paths[0])))
         else:
-            path = mozpath.abspath(path)
+            path = mozpath.realpath(mozpath.abspath(path))
         if path in self._paths:
             raise ConfigureError(
                 'Cannot include `%s` because it was included already.' % path)
         self._paths.append(path)
 
         source = open(path, 'rb').read()
 
         code = compile(source, path, 'exec')