Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dependency cycle between backend/native/subsystems and backend/python/subsystems #7793

Merged

Conversation

Eric-Arellano
Copy link
Contributor

Problem

backend/python/subsystems/python_native_code.py was depending on pants.backend.native.subsystems, but not declaring the dependency in its BUILD file.

The naive solution of adding the proper depedency to its BUILD results in a dependency cycle, as backend/native/subsystems/conan.py already depends depending on pants.backend.python.subsystems.python_tool_base.

So, ./pants test tests/python/pants_test/backend/python/tasks:pytest_run would fail when ran directly, but pass in CI because all of the targets would get the sources combined.

When changing to using the V2 test runner, we no longer allow this sort of leaky dependency usage—every dependency must be properly declared in the appropriate BUILD file. So, ./pants test tests/python/pants_test/backend/python/tasks:pytest_run started failing in #7724.

Solution

Move conan.py into a new subdirectory backend/native/subsystems/packaging, as suggested by @cosmicexplorer.

@Eric-Arellano Eric-Arellano merged commit 1091e07 into pantsbuild:master May 23, 2019
@Eric-Arellano Eric-Arellano deleted the dep-cycle-python-native branch May 23, 2019 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants