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

boundless-zebra-79556

03/01/2023, 5:47 PM
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

enough-analyst-54434

03/01/2023, 5:50 PM
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

boundless-zebra-79556

03/01/2023, 5:57 PM
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

enough-analyst-54434

03/01/2023, 6:08 PM
Was the gha yaml diff just the action update and exactly only
s|./pants|pants|
?
b

boundless-zebra-79556

03/01/2023, 6:08 PM
yes. that and the change to
pantsbuild/actions/init-pants@v4-scie-pants
from
...@v2
e

enough-analyst-54434

03/01/2023, 6:08 PM
Ok, yeah - makes no sense.
s

sparse-lifeguard-95737

03/01/2023, 6:09 PM
maybe the action is leaving the
get-pants.sh
script lying around?
will take a look
e

enough-analyst-54434

03/01/2023, 6:09 PM
That wouldn't matter. Its generally encouraged / fine to check that script in.
b

boundless-zebra-79556

03/01/2023, 6:09 PM
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

sparse-lifeguard-95737

03/01/2023, 6:09 PM
it matters if it’s not checked in (and therefore has no target in the root
BUILD.pants
)
e

enough-analyst-54434

03/01/2023, 6:10 PM
Ah, yes. That's a difference from the local repo. Gotcha.
@sparse-lifeguard-95737 has the explanation here.
s

sparse-lifeguard-95737

03/01/2023, 6:10 PM
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

enough-analyst-54434

03/01/2023, 6:11 PM
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

sparse-lifeguard-95737

03/01/2023, 6:12 PM
the latter
e

enough-analyst-54434

03/01/2023, 6:13 PM
Ah, there should be no rm then - it just shouldn't materialize files there at all ever.
👍 1
s

sparse-lifeguard-95737

03/01/2023, 6:14 PM
@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

enough-analyst-54434

03/01/2023, 6:16 PM
Or even a .gitignore entry.
🧠 1
b

boundless-zebra-79556

03/01/2023, 6:16 PM
Yeah .gitignore makes the most sense! Will do, thanks!
s

sparse-lifeguard-95737

03/01/2023, 6:22 PM
7 Views