Closed GoogleCodeExporter closed 9 years ago
This is because your output directory is a symlink.
I hear that using `sudo mount --bind /path/to/out /work/chrome/src/out` instead
of a symlink can work around this (but apparently this doesn't work well in
chroots).
So that's a possible workaround.
This patch lets ninja detect when the output directory is a symlink and makes
it write absolute paths in this case (from gutschke@), but it needs a test:
diff a/tools/gyp/pylib/gyp/generator/ninja.py
b/tools/gyp/pylib/gyp/generator/ninja.py
--- a/tools/gyp/pylib/gyp/generator/ninja.py
+++ b/tools/gyp/pylib/gyp/generator/ninja.py
@@ -108,7 +108,14 @@ def InvertRelativePath(path):
# Only need to handle relative paths into subdirectories for now.
assert '..' not in path, path
depth = len(path.split(os.path.sep))
- return os.path.sep.join(['..'] * depth)
+ inverse_path = os.path.sep.join(['..'] * depth)
+ if os.path.samefile(os.path.join(path, inverse_path), os.getcwd()):
+ return inverse_path
+ else:
+ # Symbolic links prevent us from computing a relative inverse path.
+ # Return the current directory instead, as it provides an equivalent
+ # absolute path.
+ return os.getcwd()
Original comment by thakis@chromium.org
on 15 Dec 2012 at 5:07
Hi Nico,
The patch above does not work for me. However, I've attached a new patch that
works and I've verified confirmed allows me to compile ninja with symlinks in
the Chrome OS chroot. Please see the attached patch.
Original comment by davidjames@google.com
on 20 Dec 2012 at 6:52
Attachments:
davidjames fixes this in gyp r1555.
Original comment by thakis@chromium.org
on 26 Dec 2012 at 4:50
Original issue reported on code.google.com by
davidjames@chromium.org
on 15 Dec 2012 at 12:07