Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update system call for composer #4579

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update system call for composer #4579

wants to merge 1 commit into from

Conversation

steven-lolong
Copy link
Contributor

The current system call using 'ExecOrDie' will kill all sub-processes when an error occurs running the composer install. Phing will fail during installation, but Tuefind doesn't need It. Using 'system' for the system call will solve this problem.

@@ -809,7 +810,8 @@ void ConfigureVuFind(const bool production, const VuFindSystemType vufind_system
Echo("Configuring vufind");
// We need to increase default_socket_timeout for big downloads on slow mirrors, especially Solr (default 60 seconds) .
TemporaryChDir tmp2(VUFIND_DIRECTORY);
ExecUtil::ExecOrDie(ExecUtil::LocateOrDie("php"), { "-d", "default_socket_timeout=600", ExecUtil::LocateOrDie("composer"), "install" });
system("composer install");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multiple aspects:

  1. The override of default_socket_timeout is removed (that's why we initially called PHP instead of composer directly)
  2. Due to our convention (see ExecUtil) system calls should be called with double colons at the start => ::system()
  3. If it is necessary to use a different system call, then we should create a wrapper function in ExecUtil to do so
  4. You're just calling system() without checking the result => please check the manpage, you must check the result code against -1 and maybe also output a log message containing errno.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants