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

curved-television-6568

05/26/2022, 9:59 AM
Recently I’ve started to get issues with the pre-commit hook, throwing this error:
Copy code
Exception: Unmatched glob from CLI arguments: ".github/workflows/*"
but I can’t find where that argument is coming from.. and what’s more is that I do have files there, so it’s somthing fishy going on:
Copy code
$ tree .github/workflows/
.github/workflows/
├── audit.yaml
├── cache_comparison.yaml
├── cancel.yaml
├── test-cron.yaml
└── test.yaml

0 directories, 5 files
when merging with
main
I should add.
huh, and now with a regular commit too… dang.
f

fast-nail-55400

05/26/2022, 11:49 AM
I recall @hundreds-father-404 had been making changes to how CLI specs were handled.
👍 1
c

curved-television-6568

05/26/2022, 11:50 AM
OK, narrowed it down to an issue with
--changed-since
. And I’ve seen there’s a number of issues recently touching on the changed since feature… maybe related.
Copy code
$ ./pants --changed-since=api_types_and_rules list
src/python/pants/help/help_printer.py
# ~/src/github/kaos/pants (api_types_and_rules *)
$ ./pants --changed-since=origin/api_types_and_rules list
13:48:34.52 [ERROR] 1 Exception encountered:

Engine traceback:
  in select
  in pants.vcs.changed.find_changed_owners
  in pants.engine.internals.graph.find_owners
  in pants.engine.internals.graph.resolve_unexpanded_targets
  in pants.engine.internals.specs_rules.addresses_from_raw_specs_without_file_owners
  in paths
Traceback (no traceback):
  <pants native internals>
Exception: Unmatched glob from CLI arguments: ".github/workflows/*"

Do the file(s) exist? If so, check if the file(s) are in your `.gitignore` or the global `pants_ignore` option, which may result in Pants not being able to see the file(s) even though they exist on disk. Refer to <https://www.pantsbuild.org/v2.13/docs/troubleshooting#pants-cannot-find-a-file-in-your-project>.
Traceback (most recent call last):
  File "/Users/x/src/github/kaos/pants/src/python/pants/bin/daemon_pants_runner.py", line 131, in single_daemonized_run
    runner = LocalPantsRunner.create(
  File "/Users/x/src/github/kaos/pants/src/python/pants/bin/local_pants_runner.py", line 159, in create
    specs = calculate_specs(
  File "/Users/x/src/github/kaos/pants/src/python/pants/init/specs_calculator.py", line 93, in calculate_specs
    (changed_addresses,) = session.product_request(
  File "/Users/x/src/github/kaos/pants/src/python/pants/engine/internals/scheduler.py", line 575, in product_request
    self._raise_on_error([t for _, t in throws])
  File "/Users/x/src/github/kaos/pants/src/python/pants/engine/internals/scheduler.py", line 510, in _raise_on_error
    raise ExecutionError(
pants.engine.internals.scheduler.ExecutionError: 1 Exception encountered:

Engine traceback:
  in select
  in pants.vcs.changed.find_changed_owners
  in pants.engine.internals.graph.find_owners
  in pants.engine.internals.graph.resolve_unexpanded_targets
  in pants.engine.internals.specs_rules.addresses_from_raw_specs_without_file_owners
  in paths
Traceback (no traceback):
  <pants native internals>
Exception: Unmatched glob from CLI arguments: ".github/workflows/*"

Do the file(s) exist? If so, check if the file(s) are in your `.gitignore` or the global `pants_ignore` option, which may result in Pants not being able to see the file(s) even though they exist on disk. Refer to <https://www.pantsbuild.org/v2.13/docs/troubleshooting#pants-cannot-find-a-file-in-your-project>.

Use -ldebug for more logs. 
See <https://www.pantsbuild.org/v2.13/docs/troubleshooting> for common issues.
Consider reaching out for help: <https://www.pantsbuild.org/v2.13/docs/getting-help>
@fast-nail-55400 yeah, that could be related. debugging now…
Ah, ok, found it. I get the same if I run
./pants list <some-file>
where
<some-file>
is not owned by a target.
And since --changed-since get all and any files from your git repo, not all may be owned by BUILD file targets.
such as the .github/workflow/ files..
unfortunately, it doesn’t seem like
--changed-since
respects the
unmatched-cli-globs
behavior option..
and it ought to use
ignore
by default any how..
@hundreds-father-404 FYI…
I think you’ll be able to solve this much more quickly than I 😉
OK, quick and dirty fix: https://github.com/pantsbuild/pants/pull/15654 solves my issue so I can move on for now at least 😉
h

hundreds-father-404

05/26/2022, 5:45 PM
c

curved-television-6568

05/26/2022, 5:49 PM
Thanks. Nice and tidy fix 🙂