fresh-continent-76371
09/16/2024, 10:36 AMAmbiguousOwnerError: Found multiple sibling python_distribution targets that are the closest ancestor dependents of lib/mylib:pyproject and are therefore candidates to own it: lib/mylib:mylib_wheel@parametrize=windows-gnu, lib/mylib:mylib_wheel@parametrize=linux. Only a single such owner is allowed, to avoid ambiguity. See <https://www.pantsbuild.org/2.22/docs/python/overview/building-distributions> for how python_sources targets are mapped to distributions. See <https://www.pantsbuild.org/2.22/docs/python/overview/building-distributions>.
Details
I have a parametrized python_distribution
- it's a maturin / rust python wheel. And it builds, no problems.
resources(name="rust", sources=["src/**/*.rs", "Cargo.toml"])
resource(name = "pyproject", source = "pyproject.toml")
resource(name = "readme_md", source = "README.md")
resource(name = "version_txt_file", source = "VERSION")
python_distribution(
name = "mylib_wheel",
dependencies = [
":rust",
":pyproject",
":version_txt_file",
":readme_md",
],
generate_setup = False,
provides = python_artifact(
name = "mylib",
version_file = "VERSION",
long_description_file = "README.md",
),
wheel_config_settings = {
"--build-option": [ "--python-tag", "py310.py311" ],
},
sdist=False,
**parametrize("linux", env_vars = ["RUSTUP_HOME", "CARGO_BUILD_TARGET=x86_64-unknown-linux-gnu"]),
**parametrize("windows-gnu", env_vars = ["RUSTUP_HOME", "CARGO_BUILD_TARGET=x86_64-pc-windows-gnu"]),
)
❯ pants package ::
20:34:08.60 [INFO] (pe_nailgun::nailgun_pool) Initializing Nailgun pool for 40 processes...
20:34:11.59 [INFO] (pe_nailgun::nailgun_pool) Initializing Nailgun pool for 40 processes...
20:34:17.71 [INFO] (pants.core.goals.package) Wrote dist/mylib-0.1.0-cp310-abi3-linux_x86_64.whl
20:34:17.71 [INFO] (pants.core.goals.package) Wrote dist/mylib-0.1.0-cp310-abi3-win_amd64.whl
if I list this, I see
lib/mylib:gen_changelog
lib/mylib:pyproject
lib/mylib:readme_md
lib/mylib:release
lib/mylib:mylib_wheel@parametrize=linux
lib/mylib:mylib_wheel@parametrize=windows-gnu
...
I have another project in the same repo, that is a docker image, that requires the linux wheel which was generated.. needs that mylib_wheel
...
docker_image(
name="myapp_thing_docker_image",
repository="myapp/myapp_thing",
image_tags=["{build_args.DEFAULT_TAG}"],
source="Dockerfile",
dependencies=[
"//lib/mylib:mylib_wheel@parametrize=linux",
"./myapp_thing:myapp_thing_wheel",
"//common/base-containers:images-python@parametrize=py310deb",
],
secrets = {
"mynetrc": "~/.netrc",
}
)
There is a few more dependencies there, but in essence, I see this error.
AmbiguousOwnerError: Found multiple sibling python_distribution targets that are the closest ancestor dependents of lib/mylib:pyproject and are therefore candidates to own it: lib/mylib:mylib_wheel@parametrize=windows-gnu, lib/mylib:mylib_wheel@parametrize=linux. Only a single such owner is allowed, to avoid ambiguity. See <https://www.pantsbuild.org/2.22/docs/python/overview/building-distributions> for how python_sources targets are mapped to distributions. See <https://www.pantsbuild.org/2.22/docs/python/overview/building-distributions>.
thoughts ?fresh-continent-76371
09/16/2024, 11:38 PMfresh-continent-76371
09/16/2024, 11:41 PMA_py_sources <-- python_distribution1
`-------python_distribution2
but this does not
A_py_sources <-- python_distribution1 <-- docker_image
`-------python_distribution2
fresh-continent-76371
09/16/2024, 11:42 PMAmbiguousOwnerError
of A_py_sources