https://pantsbuild.org/ logo
#general
Title
# general
a

ancient-rose-27306

01/12/2023, 5:54 PM
Hi, I have a project structure as below:
Tree of: /root/project
.
|__apps
| |__app1
| |__app2
| |__app3
And I have the
root_patterns
declared as:
[source]
root_patterns = [
"/apps/app2",
"/apps/app3",
]
But the command
./pants tailor ::
is generating
BUILD
files in
apps/app1
too. I don’t want that to happen. Could anyone please help?
e

enough-analyst-54434

01/12/2023, 5:58 PM
See the various ignore options here: https://www.pantsbuild.org/docs/reference-tailor
In short, source roots does not restrict where Pants looks to find things, it just defines path offsets.
a

ancient-rose-27306

01/12/2023, 7:11 PM
Ok, I added the subsystem tailor in my
pants.toml
file:
[tailor]
ignore_paths = [
"/apps/app1",
]
But it threw an error that said:
ValueError: Absolute paths not supported: "/apps/app1"
h

happy-kitchen-89482

01/12/2023, 7:23 PM
Those paths should be relative to the repo root. An absolute path would make no sense in a checked in file that is intended to be portable across clones of the repo.
a

ancient-rose-27306

01/12/2023, 7:24 PM
Ok, I just tried
apps/app1/**
and the
tailor
goal worked as intended.
Thanks!
a

abundant-analyst-12845

01/13/2023, 6:41 PM
Hi had a similar issue recently. and started with the tailor one but thanks to some help from the community changed mine to be
Copy code
[GLOBAL]
pants_ignore.add = [
 "/folder-to-ignore",
 "/file_to_ignore.txt",
"/another_file_to_ignore.py",
]
with this I was able to remove the
[tailo[
block
5 Views