Hi all, I'm trying to update our GHA script to use...
# general
b
Hi all, I'm trying to update our GHA script to use scie-pants. With
pantsbuild/actions/init-pants@v4-scie-pants
, when running
pants tailor --check ::
I'm seeing this cryptic message:
Copy code
Would create BUILD:
  - Add shell_sources target root

To fix `tailor` failures, run `pants tailor`.
Error: Process completed with exit code 1.
I don't have anything named
root
in my repo. Also, when running tailor command locally, it succeeds. Is this something GHA creates? Any workaround on this issue?
e
The only difference between
scie-pants
(
pants
) and
./pants
is that scie-pants will search up from the CWD it is invoked in for
pants.toml
whereas
./pants
is naturally rooted in the root of your repo side-by-side with
pants.toml
. Is CWD what you think it is in CI? Is it the repo root?
b
yeah I do have
pants.toml
in the root dir of the repo, and I used to run
./pants
instead of
pants
and it worked fine, so I'm not really sure what's changed
e
Was the gha yaml diff just the action update and exactly only
s|./pants|pants|
?
b
yes. that and the change to
pantsbuild/actions/init-pants@v4-scie-pants
from
...@v2
e
Ok, yeah - makes no sense.
s
maybe the action is leaving the
get-pants.sh
script lying around?
will take a look
e
That wouldn't matter. Its generally encouraged / fine to check that script in.
b
I see that the python example repo isn't doing tailor in its GHA, might be something we want to check there as well? sorry I saw that it does do that.
s
it matters if it’s not checked in (and therefore has no target in the root
BUILD.pants
)
e
Ah, yes. That's a difference from the local repo. Gotcha.
@sparse-lifeguard-95737 has the explanation here.
s
I can PR later if nobody beats me to it
I guess it could also download to someplace like
/tmp
instead of
.
and then not worry about cleanup
e
That's fine in a whac-a-mole way but is generally a disaster. If all GHA actions are checked out as subdirs to the cloned repo root, this will be an ever-present and growing problem. Pants gains 1st class js support and now starts seeing js actions files, etc.
Unless actions are off to the side and ours is just doing something crazy and sticking files in the main repo check out.
s
the latter
e
Ah, there should be no rm then - it just shouldn't materialize files there at all ever.
👍 1
s
@boundless-zebra-79556 I think you can unblock yourself for now by throwing an
rm get-pants.sh
into your CI job before you run
pants tailor --check
, if you’re under pressure
e
Or even a .gitignore entry.
🧠 1
b
Yeah .gitignore makes the most sense! Will do, thanks!
s