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

Projects
None yet
2 participants
@Eric-Arellano
Copy link
Contributor

commented May 23, 2019

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

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@Eric-Arellano Eric-Arellano deleted the Eric-Arellano:dep-cycle-python-native branch May 23, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.