famous-river-94971
02/01/2024, 3:45 PMpants project and am running into an issue introduced in the 2.18.x series. I have a _scaffolding directory that I use to generate new projects in my monorepo. Inside this directory, there are BUILD files, but they're templates, so pants should ignore them.
_scaffolding
├── _cdk-common
│ └── Makefile
├── ecs_task
│ ├── template.toml
│ └── {{project_name}}
│ ├── BUILD
│ ├── Makefile -> ../../_cdk-common/Makefile
│ ├── README.md
│ └── src
└── generic
├── template.toml
└── {{project_name}}
├── BUILD
├── Makefile -> ../../_cdk-common/Makefile
├── README.md
└── src
Previously, [GLOBAL].pants_ignore.add=["/_scaffolding/"] seemed to do the trick to ignore these files.
However, starting with Pants 2.18, tailor is not ignoring these files as before:
> pants \
--changed-since=origin/main \
tailor --check
08:39:40.80 [INFO] Initializing scheduler...
08:39:43.07 [INFO] Scheduler initialized.
08:39:43.61 [ERROR] 1 Exception encountered:
Engine traceback:
in `tailor` goal
IntrinsicError: Unmatched globs from `--changed-since`: ["_scaffolding/ecs_task/{{project_name}}/*", "_scaffolding/generic/{{project_name}}/*"]
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.19/docs/troubleshooting#pants-cannot-find-a-file-in-your-project>.
I've tried:
• [GLOBAL].build_ignore = ["_scaffolding/*"]
• [tailor].ignore_paths = ["_scaffolding/*"]
But I can't get past the error. Any other ideas?gorgeous-winter-99296
02/01/2024, 5:43 PMfamous-river-94971
02/01/2024, 5:44 PMfamous-river-94971
02/01/2024, 5:44 PMI've tried:
•[GLOBAL].build_ignore = ["_scaffolding/*"]
•[tailor].ignore_paths = ["_scaffolding/*"]
gorgeous-winter-99296
02/01/2024, 5:44 PMfamous-river-94971
02/01/2024, 5:44 PMfamous-river-94971
02/01/2024, 5:44 PMgorgeous-winter-99296
02/01/2024, 5:44 PMpants tailor :: actually do anything or is it only a problem in check mode?gorgeous-winter-99296
02/01/2024, 5:45 PM--changed-since=... affect it?famous-river-94971
02/01/2024, 5:46 PMDoesactually do anything or is it only a problem in check mode?pants tailor ::
pants \
--changed-since=465e752909de27763465b7cfc9c8c14de4909641 \
tailor
10:46:03.39 [ERROR] 1 Exception encountered:
Engine traceback:
in `tailor` goal
IntrinsicError: Unmatched globs from `--changed-since`: ["_scaffolding/ecs_task/{{project_name}}/*", "_scaffolding/generic/{{project_name}}/*"]
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.19/docs/troubleshooting#pants-cannot-find-a-file-in-your-project>.
Looks like I'm hitting the error even without --checkfamous-river-94971
02/01/2024, 5:47 PMpants tailor :: doesn't change anythingfamous-river-94971
02/01/2024, 5:47 PMAnd similarly, does removingaffect it?--changed-since=...
pants tailor --check :: also doesn't change anythingfamous-river-94971
02/01/2024, 5:49 PM{{project_name}} folders are tripping it up (it's an odd pattern used by the scaffolding tool)famous-river-94971
02/01/2024, 5:50 PMpants \
--changed-since=465e752909de27763465b7cfc9c8c14de4909641 \
tailor
10:50:34.50 [ERROR] 1 Exception encountered:
Engine traceback:
in `tailor` goal
IntrinsicError: Unmatched globs from `--changed-since`: ["_scaffolding/ecs_task/project_name/*", "_scaffolding/generic/project_name/*"]
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.19/docs/troubleshooting#pants-cannot-find-a-file-in-your-project>.
(changed {{project_name}} to project_name )gorgeous-winter-99296
02/01/2024, 5:51 PM--changed-since is to blame here, finding added files and asking Pants to do something with them but Pants then saying it doesn't know them.famous-river-94971
02/01/2024, 5:52 PMpants_ignore.add , it starts to complain about invalid syntax in the BUILD file (which makes sense, since it's a template, not a real BUILD file)gorgeous-winter-99296
02/01/2024, 7:09 PMfamous-river-94971
02/01/2024, 7:11 PMdelete mode 100644 _scaffolding/ecs_task/{{project_name}}/BUILD
delete mode 100644 _scaffolding/generic/{{project_name}}/BUILD
but still get the error
pants \
--changed-since=465e752909de27763465b7cfc9c8c14de4909641 \
tailor
12:11:11.06 [INFO] Initializing scheduler...
12:11:13.37 [INFO] Scheduler initialized.
12:11:14.34 [ERROR] 1 Exception encountered:
Engine traceback:
in `tailor` goal
IntrinsicError: Unmatched globs from `--changed-since`: ["_scaffolding/ecs_task/{{project_name}}/*", "_scaffolding/generic/{{project_name}}/*"]
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.19/docs/troubleshooting#pants-cannot-find-a-file-in-your-project>.famous-river-94971
02/01/2024, 7:12 PMgorgeous-winter-99296
02/01/2024, 7:12 PMgorgeous-winter-99296
02/01/2024, 7:16 PM[global].build_ignore and [global].build_patterns. I'm not sure how they're meant to interact, but if I rename the file to BUILD.tmpl and set --build-patterns='-["BUILD.*"]' it works.famous-river-94971
02/01/2024, 7:16 PMgorgeous-winter-99296
02/01/2024, 7:47 PMfoobar/{foo.py,BUILD} in my directory, it works as expected if I only ignore foobar/foo.py.famous-river-94971
02/01/2024, 7:49 PMgorgeous-winter-99296
02/01/2024, 7:53 PMDUMMY file next to your BUILD file
• After your scaffolding ignore regex, explicitly override to include the dummy file
• In your build ignore, only mention the BUILD filegorgeous-winter-99296
02/01/2024, 7:53 PMfamous-river-94971
02/01/2024, 7:53 PMgorgeous-winter-99296
02/01/2024, 7:54 PMfamous-river-94971
02/01/2024, 8:14 PMfamous-river-94971
02/01/2024, 8:14 PMfamous-river-94971
02/08/2024, 3:26 PM