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

refined-addition-53644

03/20/2023, 2:43 PM
I have been trying to install
scie-pants
in our CI/CD pipeline which runs inside a docker container on AWS. Even after modifying the PATH with
~/bin
, pants is not found. What am I missing? I run these commands
Copy code
"export PATH=$PATH:~/bin"
"./get-pants.sh"
"pants --version"
This is the log from the container
Copy code
[Container] 2023/03/20 11:28:34 Running command export PATH=$PATH:~/bin
[Container] 2023/03/20 11:28:34 Running command ./get-pants.sh
Downloading and installing the pants launcher ...
Installed the pants launcher from <https://github.com/pantsbuild/scie-pants/releases/latest/download/scie-pants-linux-x86_64> to /root/bin/pants
Running `pants` in a Pants-enabled repo will use the version of Pants configured for that repo.
In a repo not yet Pants-enabled, it will prompt you to set up Pants for that repo.
[Container] 2023/03/20 11:28:35 Running command pants --version
/codebuild/output/tmp/script.sh: 4: pants: not found
1
1
e

enough-analyst-54434

03/20/2023, 2:49 PM
So, get-pants.sh has options, you might use them to place pants elsewhere, say in /usr/bin. I suspect root is not the final user.
Or just use an explicit path instead of
pants
like
/root/bin/pants
. In short, there is absolutely no magic at all here. This is just placing a binary on the filesystem.
Looking at your OP @refined-addition-53644 and knowing nothing about this product myself, you use a bashism
export ...
. For that to work the ambient shell must be bash and the following lines must all run in that same shell session. Maybe that's not the case?
r

refined-addition-53644

03/20/2023, 2:57 PM
They are bash shell. These are shell commands run by AWS inside codebuild. But your first guess was correct. I think the final usr isn’t root but some codebuild user. I see
/usr/local/bin/
being available. What option should I use to install directly there?
e

enough-analyst-54434

03/20/2023, 2:58 PM
I'm going to let you do the same reading I'd have to do.
I forget the naming.
r

refined-addition-53644

03/20/2023, 2:58 PM
ah ok! Let me check. Thanks
It’s
--bin-dir
or
-d
Should we pin scie-pants version too?
1
e

enough-analyst-54434

03/20/2023, 3:01 PM
I have no clue what your requirements are. That's totally up to you.
r

refined-addition-53644

03/20/2023, 3:02 PM
yeah I guess safer to do.
That worked! So much faster bootstrapping now
e

enough-analyst-54434

03/20/2023, 3:12 PM
Ok, great. So it was a user switch issue?
r

refined-addition-53644

03/20/2023, 3:13 PM
Yes
3 Views