Commit 0bd2954d authored by Adrienne Walker's avatar Adrienne Walker Committed by Commit Bot

Allow Android to be built in an out-of-repo build dir

My ssd ran out of space to build Android so in the meantime,
I symlinked it into my home dir.  However, when I did this, my Android
build resulted in an exception where it would try to symlink a file to
itself: ~/out/gn_android/gen/components/version_info/android/java/org/chromium/components/version_info/VersionConstants.java

This patch checks and avoids this case.

Change-Id: I0d0f6b90e40a1e9af710ccca8a626116f0ec6f75
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1710783
Commit-Queue: enne <enne@chromium.org>
Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#682844}
parent 706252f6
......@@ -165,7 +165,15 @@ def _OnStaleMd5(lint_path,
src_dir = _NewTempSubdir('SRC_ROOT')
src_dirs.append(src_dir)
cmd.extend(['--sources', _RebasePath(src_dir)])
os.symlink(os.path.abspath(src), PathInDir(src_dir, src))
# In cases where the build dir is outside of the src dir, this can
# result in trying to symlink a file to itself for this file:
# gen/components/version_info/android/java/org/chromium/
# components/version_info/VersionConstants.java
src = os.path.abspath(src)
dst = PathInDir(src_dir, src)
if src == dst:
continue
os.symlink(src, dst)
if srcjars:
srcjar_paths = build_utils.ParseGnList(srcjars)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment