Skip to content

Commit

Permalink
chore: 4869108: handle absolute and relative gn imports in autoninja
Browse files Browse the repository at this point in the history
  • Loading branch information
jkleinsc committed Sep 18, 2023
1 parent d91ba21 commit e4458e9
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .circleci/config/base.yml
Expand Up @@ -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
Expand Down

0 comments on commit e4458e9

Please sign in to comment.