Hey folks, been finding that if I remove a BUILD f...
# general
s
Hey folks, been finding that if I remove a BUILD file and run
./pants tailor <path-to-removed-file>
, the BUILD file is not regenerated even if there are still unmapped targets in that directory. Is this expected behaviour? This also happens if I run
./pants --changed-since=<commit-with-removed-file> tailor
h
Try
./pants tailor <path to directory containing removed file>
?
tailor
acts on dirs
s
This works, but
./pants --changed-since=... tailor
still doesn’t (which I’m assuming is because
—changed-since
generates a list of files). To get around this, we could iterate through all changed files, grab the associated directory, then call tailor. But seems like having
tailor
also work on the file level would be a better fix?
h
Correct
that is how
--changed-since
works, you're right
Not sure what it would mean for tailor to work at the file level? It works by detecting the presence of files in a directory...
Maybe it would mean "the directory the files are in", as you suggest
s
Sorry, what I mean is, it seems buggy that
./pants --changed-since=… tailor
does not regenerate removed BUILD files?
Here’s a minimal example replicating the issue (ran
./pants --changed-since=origin/main tailor
in this repo https://github.com/njgrisafi/pants-example/tree/example-tailor-issue) @happy-kitchen-89482
h
Gotcha, makes sense. It would be a pretty easy change to say that
./pants tailor path/to/BUILD
should do the same thing as
./pants tailor path/to
, and I think that would take care of this.
Can you open a ticket on https://github.com/pantsbuild/pants?
s