cool-easter-32542
02/01/2024, 8:14 PM_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 being unable 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 the error persists.
Pants version
2.19.0
The issue seems to have been introduced in the 2.18.x series, as I never had a problem with this before 2.18.x.
OS
MacOS and Linux
Additional info
@tgolsson and I were discussing this in Slack. He was able to reproduce the issue, as well.
Workaround
From @tgolsson :
1. Add a DUMMY file next to your BUILD file
2. After your scaffolding ignore regex, explicitly override to include the dummy file
3. In your build ignore, only mention the BUILD filepantsbuild/pants
cool-easter-32542
02/08/2024, 3:24 PM