testing: tests for mypyc failed when gtest was installed on my system
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 20.6k
- Forks
- 3.3k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
Bug Report
Within my fork of the mypy repo, the test mypyc/test/test_external.py failed while attempting to build libgtest.a with compilation errors like the following:
In file included from ../src/gtest-all.cc:42:
../src/gtest.cc:330:43: error: use of undeclared identifier 'GetArgvs'
static bool GTestIsInitialized() { return GetArgvs().size() > 0; }
^
To Reproduce
Run the tests as documented.
Expected Behavior
Ideally, compilation of the Google Test library should succeed, whether or not another version of Google Test is installed.
Actual Behavior
Compilation fails because the system-installed version of the header files are picked up. This is due to this line https://github.com/python/mypy/blob/05d9fb15dcec8bde4e7184ca387e7d8acea68792/mypyc/external/googletest/make/Makefile#L22 which adds the parent directory to the list of system includes. Running the compiler command with the -v option shows that the -I directives are then ignored, because they're seen as duplicates of the system paths.
Your Environment
My development environment is:
MacOS 10.15.7
Apple clang version 12
The latest commit in my clone of mypy is 05d9fb
brew install a recent version of Google Test.
Python interpreter version: 3.9
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit mypyc/test/test_external.py und mypyc/external/googletest/make/Makefile in Zeile 22. Reproduziere den Test mit einem systemweit installierten Google Test, untersuche den Compiler-Befehl und die Include-Pfade und bestätige, dass die Bibliothek von Google Test erfolgreich erstellt wird, wenn diese Header installiert sind.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- cpp, python
- Bereich
- build-system, testing-qa
- Issue-Typ
- Bug
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Aktivitätsstatus
- Veraltet
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 35/100