Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Exclude Antlr test from testprojects to avoid interpreter conflict (#…
…6944) ### Problem Antlr 3 only works with Python 2, so we have to constrain that part to only using Python 2, as done in #6924. However, this results in one of the `testprojects` shards failing when using Python 3 due to mixing a Py2-only constraint with a Py3-only constraint. ```bash $ export PANTS_PYTHON_SETUP_INTERPRETER_CONSTRAINTS='["CPython>=3.5,<4"]' $ ./pants clean-all test testprojects/src/python/antlr:eval testprojects/src/python/antlr:eval-bin testprojects/src/python/coordinated_runs:creator testprojects/src/python/coordinated_runs:phaser testprojects/src/python/coordinated_runs:waiter testprojects/src/python/print_env:print_env ... 18:47:02 00:04 [pyprep] 18:47:02 00:04 [interpreter] Invalidated 4 targets. FAILURE: Unable to detect a suitable interpreter for compatibilities: CPython>=2.7,<3 && CPython>=3.5,<4 (Conflicting targets: testprojects/src/python/antlr:eval, testprojects/src/python/coordinated_runs:creator) ``` We can get Antlr to evaluate correctly when there are no other targets, but `test_testprojects_integration.py` works by running multiple targets with one single command so this does not help. ```bash $ export PANTS_PYTHON_SETUP_INTERPRETER_CONSTRAINTS='["CPython>=3.5,<4"]' $ ./pants clean-all test testprojects/src/python/antlr:eval testprojects/src/python/antlr:eval-bin {interpreter will resolve correctly} ``` ### Solution Exclude the Antlr testproject from `projects/testprojects`. The code is already covered by the tests in `backend/codegen/antlr/test_antlr_py_gen_integration.py`. This is a much simpler solution than trying to come up with logic in `test_testprojects_integration.py` to handle interpreter conflicts like this, e.g. putting Python 2 only targets in one dedicated shard. ### Also fixes duplicate .so binary names By removing the antlr test, the shards were redistributed in `test_testprojects_integration.py`. This led to `python_distribution/ctypes` and `python_distribution/ctypes_with_extra_compiler_flags` running at the same time, which resulted in the error `FAILURE: The name 'asdf-cpp' was used for two shared libraries`. We fix this by making the `asdf-cpp` name unique for all of the 3 uses.
- Loading branch information
1 parent
9b8528b
commit dbc7ef9
Showing
11 changed files
with
19 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters