ANDROID: Revert "gen_compile_commands.py: fix path resolve with symlinks in it"
* This reverts commit 880946158b
* Reason for revert: It breaks `kleaf_kythe` target.
Bug: 320449031
Change-Id: I63ad1a8a31c48dff8c9cb699b43dee6c1d46abd6
Signed-off-by: Ulises Mendez Martinez <umendez@google.com>
This commit is contained in:
committed by
Treehugger Robot
parent
71f973ebfe
commit
22858186da
@@ -64,7 +64,7 @@ def parse_arguments():
|
||||
args = parser.parse_args()
|
||||
|
||||
return (args.log_level,
|
||||
os.path.realpath(args.directory),
|
||||
os.path.abspath(args.directory),
|
||||
args.output,
|
||||
args.ar,
|
||||
args.paths if len(args.paths) > 0 else [args.directory])
|
||||
@@ -172,8 +172,8 @@ def process_line(root_directory, command_prefix, file_path):
|
||||
# by Make, so this code replaces the escaped version with '#'.
|
||||
prefix = command_prefix.replace('\#', '#').replace('$(pound)', '#')
|
||||
|
||||
# Return the canonical path, eliminating any symbolic links encountered in the path.
|
||||
abs_path = os.path.realpath(os.path.join(root_directory, file_path))
|
||||
# Use os.path.abspath() to normalize the path resolving '.' and '..' .
|
||||
abs_path = os.path.abspath(os.path.join(root_directory, file_path))
|
||||
if not os.path.exists(abs_path):
|
||||
raise ValueError('File %s not found' % abs_path)
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user