From e4458e9520e2fe5a963addf9cde8dcb68a376323 Mon Sep 17 00:00:00 2001 From: John Kleinschmidt Date: Mon, 18 Sep 2023 11:31:54 -0400 Subject: [PATCH] chore: 4869108: handle absolute and relative gn imports in autoninja https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4869108 --- .circleci/config/base.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.circleci/config/base.yml b/.circleci/config/base.yml index 6ea4a0bf1b8ab..802cb228e4809 100644 --- a/.circleci/config/base.yml +++ b/.circleci/config/base.yml @@ -265,6 +265,33 @@ step-depot-tools-get: &step-depot-tools-get EOF git apply --3way gclient.diff fi + # Fixup autoninja until https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4869108 is merged + cat > autoninja.diff \<< 'EOF' + diff --git a/autoninja.py b/autoninja.py + index 34db3c3..a3effe0 100755 + --- a/autoninja.py + +++ b/autoninja.py + @@ -37,9 +37,14 @@ + for line in f: + match = import_re.match(line) + if match: + - import_path = os.path.normpath( + - os.path.join(output_dir, '..', '..', + - match.groups()[0][2:])) + + raw_import_path = match.groups()[0] + + if raw_import_path[:2] == "//": + + import_path = os.path.normpath( + + os.path.join(output_dir, '..', '..', + + raw_import_path[2:])) + + else: + + import_path = os.path.normpath( + + os.path.join(os.path.dirname(path), raw_import_path)) + for import_line in _gn_lines(output_dir, import_path): + yield import_line + else: + + EOF + git apply autoninja.diff # Ensure depot_tools does not update. test -d depot_tools && cd depot_tools touch .disable_auto_update