summaryrefslogtreecommitdiff
path: root/android-mainline/ANDROID-Revert-gen_compile_commands.py-fix-path-resolve-with-symlinks-in-it.patch
diff options
context:
space:
mode:
Diffstat (limited to 'android-mainline/ANDROID-Revert-gen_compile_commands.py-fix-path-resolve-with-symlinks-in-it.patch')
-rw-r--r--android-mainline/ANDROID-Revert-gen_compile_commands.py-fix-path-resolve-with-symlinks-in-it.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/android-mainline/ANDROID-Revert-gen_compile_commands.py-fix-path-resolve-with-symlinks-in-it.patch b/android-mainline/ANDROID-Revert-gen_compile_commands.py-fix-path-resolve-with-symlinks-in-it.patch
new file mode 100644
index 00000000..777d8050
--- /dev/null
+++ b/android-mainline/ANDROID-Revert-gen_compile_commands.py-fix-path-resolve-with-symlinks-in-it.patch
@@ -0,0 +1,39 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Ulises Mendez Martinez <umendez@google.com>
+Date: Tue, 16 Jan 2024 15:24:10 +0000
+Subject: ANDROID: Revert "gen_compile_commands.py: fix path resolve with
+ symlinks in it"
+
+* This reverts commit 880946158b01138c06e93e4aa4255ffbfe70e1c8
+* Reason for revert: It breaks `kleaf_kythe` target.
+
+Bug: 320449031
+Change-Id: I63ad1a8a31c48dff8c9cb699b43dee6c1d46abd6
+Signed-off-by: Ulises Mendez Martinez <umendez@google.com>
+---
+ scripts/clang-tools/gen_compile_commands.py | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/scripts/clang-tools/gen_compile_commands.py b/scripts/clang-tools/gen_compile_commands.py
+--- a/scripts/clang-tools/gen_compile_commands.py
++++ b/scripts/clang-tools/gen_compile_commands.py
+@@ -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 {