cold-vr-15232
06/28/2023, 11:51 AMfresh-cat-90827
06/28/2023, 12:29 PMfresh-cat-90827
06/28/2023, 12:30 PMAlso, I can't use a catch_all rule spec ({}, "*"), it says target must not be empty.would you please share the ruleset you have and the error output? This should help us troubleshoot
cold-vr-15232
06/28/2023, 12:32 PM# src/a/BUILD (continued from previous example)
__dependencies_rules__(
(
{"type": python_sources}, # We can use the target type unquoted when we don't need glob syntax
"src/a/**", # May depend on anything from src/a/
"src/b/lib.py", # May depend on specific file
"!*", # May not depend on anything else. This is our "catch all" rule, ensuring there will never be any fall-through, which would've been an error
),
# We need another rule set, in case we have non-python sources in here, to avoid fall-through.
# Sticking in a generic catch-all allow-all rule.
({}, "*"),
)
fresh-cat-90827
06/28/2023, 12:47 PM("*", "*"),
and I think this should have the same effectfresh-cat-90827
06/28/2023, 12:47 PMMappingError: Failed to parse ./cheeseshop/repository/BUILD:
BuildFileVisibilityRulesError: Invalid rule spec, Target spec must not be empty. {}
cold-vr-15232
06/28/2023, 1:13 PMfresh-cat-90827
06/28/2023, 1:29 PMcurved-television-6568
06/28/2023, 1:52 PM“TypeError: decoding to str: need a bytes-like object, Registrar found”,that is a bug, thanks for reporting. I recall this having been reported once before but no issue was submitted so it’s been overlooked. https://github.com/pantsbuild/pants/issues/19390
# We need another rule set, in case we have non-python sources in here, to avoid fall-through.
# Sticking in a generic catch-all allow-all rule.
This is wrong, sorry about that. We really should have doc-tests 😅 The selector({}, "*"),
{}
doesn’t match anything, so will not apply to anything so the rules that follow (the "*"
in this case) won’t ever be used, hence the error message.
https://github.com/pantsbuild/pants/issues/19391