mozbuild includes doesn't seem able to handle symbolic links?

RESOLVED FIXED in Firefox 48

Status

Firefox Build System
General
RESOLVED FIXED
2 years ago
2 months ago

People

(Reporter: bbouvier, Unassigned)

Tracking

Trunk
mozilla48

Firefox Tracking Flags

(firefox48 fixed)

Details

MozReview Requests

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

(Reporter)

Description

2 years ago
My tree looks like this:
- /code/mozilla-inbound contains a clone of the hg repository
- /home/ben/mozilla/repo/ is a symbolic link to /code/mozilla-inbound
- my build script runs /home/ben/mozilla/repo/js/src/configure in my build dir.

What I get, since this morning (UTC+1 time):

mozbuild.configure.ConfigureError: Cannot include `/code/mozilla-inbound/browser/moz.configure` because it is not in a subdirectory of `/home/ben/mozilla/repo` 

It was working like a charm yesterday, so I guess this is something new.

Changing my build script to run /code/mozilla-inbound/js/src/configure works around the issue.

Is it that mozbuild can not handle symbolic links? If so, could it?
Does this fix it:

diff --git a/python/mozbuild/mozbuild/configure/__init__.py b/python/mozbuild/mozbuild/configure/__init__.py
index d51bb24..0d0985f 100644
--- 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')
Blocks: 1247836
(Reporter)

Comment 2

2 years ago
(In reply to Mike Hommey [:glandium] from comment #1)
> Does this fix it:
Yes it does.
Created attachment 8728859 [details]
MozReview Request: Bug 1254913 - Handle symbolic links in the path leading to moz.configure

Review commit: https://reviewboard.mozilla.org/r/39171/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/39171/
Attachment #8728859 - Flags: review?(gps)
Comment on attachment 8728859 [details]
MozReview Request: Bug 1254913 - Handle symbolic links in the path leading to moz.configure

https://reviewboard.mozilla.org/r/39171/#review35925

Fine by me.
Attachment #8728859 - Flags: review+
Attachment #8728859 - Flags: review?(gps)

Comment 6

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/b8b72c9bfc6d
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox48: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla48

Updated

2 months ago
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.