Skip to content

Pie attempts to install missing build tools without sudo #597

@hackel

Description

@hackel

What are you trying to do?
Trying to install a package.

What platform, and PIE version are you using?
Amazon Linux 2023

🥧 PHP Installer for Extensions (PIE) 1.4.2, from The PHP Foundation
You are running PHP 8.4.10
Target PHP installation: 8.4.10 nts, on Linux/OSX/etc x86_64 (from /usr/bin/php)

Steps to reproduce the issue

  1. pie install -v phpredis/phpredis

What do you expect to happen?

Checking if all build tools are installed.
The following build tools are missing: bison, re2c
The following command will be run: dnf install -y bison re2c
Would you like to install them now? Y

Packages are installed with sudo.

What is actually happening

Could not install the missing build tools. You may need to install them manually.
Symfony\Component\Process\Exception\ProcessFailedException: The command "'dnf' 'install' '-y' 'bison' 're2c'" failed
Error: This command has to be run with superuser privileges (under the root user on most systems).
 in phar:///usr/local/bin/pie/vendor/symfony/process/Process.php:271

Complete logs/output
See above.

Anything else?
After encountering the ProcessFailedException, Pie didn't stop to give me a chance to correct (or even see) the error. It continued with the build, and in this case, it happened to work just fine without those two packages. It eventually did use sudo to install the compiled extension itself.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingbug-confirmedMaintainers could reproduce the issue and will investigatemaintainer investigatingThis ticket is being investigated by maintainers. Please check with us before contributing PRs etc!

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions