<@UB2J9BQA0> I ran into <https://github.com/pantsb...
# development
s
@hundreds-father-404 I ran into https://github.com/pantsbuild/pants/issues/16230 when testing out the latest sha on 2.13.x. I saw you have some maybe-relevant commits in the diff - could you take a look when you get a minute?
👍 1
👀 1
h
Note that we don't parameterize any of our targets so I'm not sure why Pants is trying to figure out which parameterization to use.
Fishy. Thanks
🐟 1
@witty-crayon-22786 let's hold off on release until we can fix this
👍 1
s
thanks for investigating!
h
thanks for reporting! Pants community is the best ❤️
w
thanks for reporting! can you confirm that this doesn’t repro locally via
./pants dependencies src/projects/rhp/backend:celery
? it should be the exact same codepath, so something is strange
s
checking now…
yeah it repros
w
ah, pheew. ok, that’s less weird.
s
I tested w/ fresh local caches (including bootstrap) to simulate CI. will see if it happens if I use my warmed-up cache
yes it does
w
and
celery.py
definitely exists on disk, right?
s
yep!
missed it when reporting the issue
lmk if you want a trace-level one
w
not sure if it will help, but if so the debug one should be sufficient: thanks.
hm. really not seeing it. given that you’re able to reproduce, are you able to add some debug output in here: https://github.com/pantsbuild/pants/blob/757a2664cb82fac6693f13609ce14911d8fd88e3/src/python/pants/engine/internals/graph.py#L1132-L1151 ? perhaps by logging* both
explicitly_provided_includes
and
explicit_dependency_parametrizations
with
<http://logger.info|logger.info>(..)
?
1
h
(what's really weird to both Stu and me is why the error message isn't showing the generated file targets like
celery.py
. It only shows the target generator
:backend
)
s
Yeah I can poke around and report back
Probably later tonight / tomorrow morning
w
yea, no worries. thanks again.
s
Copy code
18:52:02.71 [INFO] explicitly_provided_includes: FrozenOrderedSet([Address(src/projects/rhp/backend/celery.py)])
18:52:02.71 [INFO] explicit_dependency_parametrizations: (_TargetParametrizations([_TargetParametrization(original_target=<class 'pants.backend.python.target_types.PythonSourceTarget'>(address=src/projects/rhp/backend:backend, alias='python_source', residence_dir='src/projects/rhp/backend', dependencies=(':src', './migrations'), description=None, interpreter_constraints=None, resolve=None, run_goal_use_sandbox=True, skip_black=False, skip_isort=False, skip_mypy=False, skip_pylint=False, source=apps.py, tags=None), parametrization=FrozenDict({}))]),)
in which the more complex directory structure of the problem dir is revealed 😅 the full current structure is:
Copy code
src/projects/rhp/backend/
  BUILD.pants
  apps.py
  asgi.py
  celery.py
  manage.py
  settings.py
  # More python src
  migrations/
    BUILD.pants # just contains python_sources()
    # Python sources
  management/
    commands/
      BUILD.pants # just contains python_sources()
      # Python sources
and then the
BUILD.pants
is (translated from a macro so might be typos):
Copy code
python_source(source="apps.py", dependencies=[":src", "./migrations"])

python_sources(name="src", sources=["!manage.py", "!apps.py", "*.py"])

python_source(
    name="manage.py",
    source="manage.py",
    dependencies=["./management/commands"],
)

pex_binary(
    name="manage",
    entry_point="manage.py",
    dependencies=["./management/commands"],
)

pex_binary(
    name="main",
    entry_point="gunicorn",
    dependencies=[
        "./asgi.py",
        "3rdparty#gunicorn",
        "3rdparty/pants-only#uvicorn",
    ],
    restartable=True,
)

pex_binary(
    name="celery",
    entry_point="celery.bin.celery",
    dependencies=[
        "./celery.py",
    ],
    restartable=True,
)
h
parametrization=FrozenDict({}))])
Weird, I think we would expect this to have the generated
python_source
targets. (Even though you're not using
parametrize()
)
w
it’s not a generator…
original_target=<class 'pants.backend.python.target_types.PythonSourceTarget'>
👀 1
so… hm
h
wait how is this possible.
src/projects/rhp/backend/celery.py
must correspond to a generated
python_source
target, as file address only works w/ generated targets But then the corresponding parametrization is a target
src/projects/rhp/backend:backend
which is
python_source
@sparse-lifeguard-95737 what is the BUILD file for
rhp/backend
? Same as what you sent?
w
… mmm.
i have an idea.
👀 1
h
I'm not following, other than my confusion how the address
celery.py
would end up being the address
backend:backend
, which is itself
python_source
w
my brain is moving a bit sluggishly, but this seems like it might be enough to repro… tomorrow morning, heh
s
@hundreds-father-404 yes - there is a macro in the real
BUILD.pants
that expands to the
python_source
target for
apps.py
and the
python_sources
target, but the end targets are identical to what I sent
w
fix is queued for 2.13.x here: https://github.com/pantsbuild/pants/pull/16250: thanks again for helping to repro!
❤️ 2
s
thanks for the quick fix (and all the other quick fixes)!!
❤️ 1
w
M1 wheels might not be available until tomorrow though