Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d55b743

Browse files
ci(build): Fix ctags detection
1 parent f6c26b9 commit d55b743

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

‎.github/scripts/get_affected.py‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@
184184
include_regex = re.compile(r'#include\s*[<"]([^">]+)[">]')
185185

186186
# Ctags-based symbol index (optional)
187+
ctags_executable = None
187188
ctags_available = False
188189
ctags_header_to_qnames: dict[str, set[str]] = {}
189190
ctags_defs_by_qname: dict[str, set[str]] = {}
@@ -204,11 +205,20 @@ def detect_universal_ctags() -> bool:
204205
"""
205206
Return True if Universal Ctags is available on PATH.
206207
"""
207-
ctags_path = shutil.which("ctags-universal")
208+
exec_names = ["ctags-universal", "ctags"]
209+
210+
global ctags_executable
211+
for exec_name in exec_names:
212+
ctags_path = shutil.which(exec_name)
213+
if ctags_path:
214+
break
208215
if not ctags_path:
209216
return False
217+
218+
ctags_executable = ctags_path
219+
210220
try:
211-
out = subprocess.run([ctags_path, "--version"], capture_output=True, text=True, check=False)
221+
out = subprocess.run([ctags_executable, "--version"], capture_output=True, text=True, check=False)
212222
return "Universal Ctags" in (out.stdout + out.stderr)
213223
except Exception:
214224
return False
@@ -241,7 +251,7 @@ def run_ctags_and_index(paths: list[str]) -> tuple[dict[str, set[str]], dict[str
241251
Paths in results are relative to project_root to match this script's expectations.
242252
"""
243253
cmd = [
244-
"ctags-universal", "-R", "-f", "-",
254+
ctags_executable, "-R", "-f", "-",
245255
"--map-C++=+.ino",
246256
"--languages=C,C++",
247257
"--kinds-C=+p",

‎.github/workflows/push.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ jobs:
9797
IS_PR: ${{ github.event_name == 'pull_request' }}
9898
MAX_CHUNKS: ${{ env.MAX_CHUNKS }}
9999
run: |
100-
which ctags-universal
100+
(which ctags-universal || which ctags) || (echo "Error: Neither ctags-universal nor ctags found in PATH" && exit 1)
101101
python3 ./.github/scripts/get_affected.py --debug ${{ steps.changed-files.outputs.all_changed_files }} > affected_sketches.txt
102102
103103
- name: Upload affected sketches

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /