Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Bug Report: diagtool not found on Windows

Aperta
#4,802 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

good to go :rocket:

Bug Report: diagtool not found on Windows

Summary

On Windows systems, CodeChecker fails to find the diagtool binary because it searches for diagtool instead of diagtool.exe.

CodeChecker version

  • Current repository state (commit: ce5ed250)

To Reproduce

Steps to reproduce the behaviour:

  1. Install CodeChecker on Windows
  2. Run analysis with ClangTidy analyzer
  3. The get_diagtool_bin() function in analyzer.py fails to locate diagtool.exe

Root Cause

In analyzer/codechecker_analyzer/analyzers/clangtidy/analyzer.py, line 153:

diagtool_bin = clang_tidy_bin.parent / 'diagtool'

The code hardcodes the binary name as diagtool without considering the .exe extension required on Windows platforms.

Expected Behaviour

The function should:

  • Look for diagtool.exe on Windows (sys.platform == 'win32')
  • Look for diagtool on Unix-like systems
  • Similarly handle versioned binaries like diagtool-14.exe

Affected File

analyzer/codechecker_analyzer/analyzers/clangtidy/analyzer.py - get_diagtool_bin() function

Fix

The fix adds platform-specific binary name handling:

# Find diagtool next to the clang binary.
diagtool_name = 'diagtool.exe' if sys.platform == 'win32' else 'diagtool'
diagtool_bin = clang_tidy_bin.parent / diagtool_name
if diagtool_bin.exists():
    return diagtool_bin

# Sometimes diagtool binary has a version number in its name: diagtool-14.
version = ClangTidy.get_binary_version()

if version:
    versioned_name = f'diagtool-{version.major}'
    if sys.platform == 'win32':
        versioned_name += '.exe'
    if diagtool_bin.with_name(versioned_name).exists():
        return diagtool_bin.with_name(versioned_name)

Desktop (please complete the following information)

  • OS: Windows 11 Pro
  • Platform: win32

Additional Context

  • This issue affects all Windows users using ClangTidy analyzer
  • The same pattern should be checked for any other binary lookups in the codebase
  • The sys.platform == 'win32' check is already used in other parts of the codebase for Windows-specific handling
Lingua principale
Python
Stelle
2.6k
Fork
494
Merge medio
3g 1h
PR unite (30g)
20

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Ericsson/codechecker

Tutte le issue di Ericsson/codechecker

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.