https://pantsbuild.org/ logo
#development
Title
# development
s

sparse-lifeguard-95737

07/19/2022, 8:49 PM
@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

hundreds-father-404

07/19/2022, 8:57 PM
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

sparse-lifeguard-95737

07/19/2022, 8:58 PM
thanks for investigating!
h

hundreds-father-404

07/19/2022, 8:58 PM
thanks for reporting! Pants community is the best ❤️
w

witty-crayon-22786

07/19/2022, 9:26 PM
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

sparse-lifeguard-95737

07/19/2022, 9:54 PM
checking now…
yeah it repros
w

witty-crayon-22786

07/19/2022, 9:55 PM
ah, pheew. ok, that’s less weird.
s

sparse-lifeguard-95737

07/19/2022, 9:55 PM
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

witty-crayon-22786

07/19/2022, 9:56 PM
and
celery.py
definitely exists on disk, right?
s

sparse-lifeguard-95737

07/19/2022, 9:56 PM
yep!
missed it when reporting the issue
lmk if you want a trace-level one
w

witty-crayon-22786

07/19/2022, 9:57 PM
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

hundreds-father-404

07/19/2022, 10:11 PM
(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

sparse-lifeguard-95737

07/19/2022, 10:13 PM
Yeah I can poke around and report back
Probably later tonight / tomorrow morning
w

witty-crayon-22786

07/19/2022, 10:14 PM
yea, no worries. thanks again.
s

sparse-lifeguard-95737

07/19/2022, 11:01 PM
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

hundreds-father-404

07/19/2022, 11:02 PM
parametrization=FrozenDict({}))])
Weird, I think we would expect this to have the generated
python_source
targets. (Even though you're not using
parametrize()
)
w

witty-crayon-22786

07/19/2022, 11:03 PM
it’s not a generator…
original_target=<class 'pants.backend.python.target_types.PythonSourceTarget'>
👀 1
so… hm
h

hundreds-father-404

07/19/2022, 11:05 PM
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

witty-crayon-22786

07/19/2022, 11:06 PM
… mmm.
i have an idea.
👀 1
h

hundreds-father-404

07/19/2022, 11:08 PM
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

witty-crayon-22786

07/19/2022, 11:08 PM
my brain is moving a bit sluggishly, but this seems like it might be enough to repro… tomorrow morning, heh
s

sparse-lifeguard-95737

07/19/2022, 11:24 PM
@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

witty-crayon-22786

07/20/2022, 6:38 PM
fix is queued for 2.13.x here: https://github.com/pantsbuild/pants/pull/16250: thanks again for helping to repro!
❤️ 2
s

sparse-lifeguard-95737

07/20/2022, 7:00 PM
thanks for the quick fix (and all the other quick fixes)!!
❤️ 1
w

witty-crayon-22786

07/21/2022, 2:37 AM
M1 wheels might not be available until tomorrow though