Composer Install stuck

We’re having trouble doing a composer install of Concrete CMS which we’ve been able to do without a problem in a the past.

The composer install gets stuck in the same place every time:

Gathering patches from concretecms/dependency-patches (extra.patches). Applying patch concretecms/dependency-patches/Add PHP 8.1 compatibility to anahkiasen/html-object...

We’ve tried various Composer and PHP version but without success.

Is anyone experiencing similar issues or have an idea how to resolve?

Are you using a Mac or FreeBSD?
If so, you have to install the GNU flavor of the “patch” program

Yes, using a Mac.

How do I ‘install the GNU flavor of the “patch” program’?

I think with brew install gpatch but I don’t own a Mac and I know nothing more about it.

2 Likes

Thanks @mlocati working now.

1 Like

What gpatch do I have to install exactly? Working on a mac here and anahkiasen/html-object is stuck

As far as I remember, I just ran brew install gpatch in my terminal as suggested by @mlocati and then ran the composer install again and everything worked.

What’s the error? There should be something like, “failed to apply the patch with …”

I don’t have patch or gpatch installed on my Mac, but composer create-project -n concretecms/composer my_project works for me. Looking at the code, it seems that Git could be used as well.

On Mac OS, Git is often included as part of Xcode and if that has been updated recently, you’re ofter required to accept any changes to the T&C by issuing the following command in the terminal:

sudo xcodebuild -license

then agree to the license. If you haven’t done that, then Git won’t run and could be causing the problem.

It doesn’t work. The patching of the anahkiasen/html-object still hangs, as do all the following. I did a workaround (ugly). I SSHed into my provider, uploaded the composer.json, did a composer update there and downloaded everything. I know it’s so ugly but I don’t have time

I have the exact same problem. I’ve updated brew. I’ve installed the correct version of gpatch. Nothing works.

Hitting control-c six times will make it break out of the patch, but then immediately it hangs on the next patch.

I’ve tried many previous versions of the installer and they all to the same thing. This is the abbreviated log of 9.3.8:

120 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Gathering patches from concretecms/dependency-patches (extra.patches).
Applying patch concretecms/dependency-patches/Add PHP 8.1 compatibility to anahkiasen/html-object...

HANG
Hit control-c six times

^C^C^C^C^C^CUnable to apply the patch "Add PHP 8.1 compatibility" provided by "concretecms/dependency-patches": failed to apply the patch with the patch command: patching file 'src/Traits/Tag.php'
Ignoring previously applied (or reversed) patch.
1 out of 1 hunks ignored--saving rejects to '/private/var/folders/2g/h_t_7g0s597_qzlj0smqmn3w0000gn/T/PCHi8bjtukccurab8CseBT/1.rej'
patching file 'src/Traits/TreeObject.php'
Ignoring previously applied (or reversed) patch.
1 out of 1 hunks ignored--saving rejects to 'src/Traits/TreeObject.php.rej'

Applying patch concretecms/dependency-patches/Fix PHP 8 compatibility to gettext/gettext...

HANG
Hit control-c six times

 ^C^C^C^C^C^CUnable to apply the patch "Fix PHP 8 compatibility" provided by "concretecms/dependency-patches": failed to apply the patch with the patch command: patching file 'src/Translations.php'
Ignoring previously applied (or reversed) patch.
1 out of 1 hunks ignored--saving rejects to '/private/var/folders/2g/h_t_7g0s597_qzlj0smqmn3w0000gn/T/PCHi8bjtukccurab8CseBT/9.rej'

Applying patch concretecms/dependency-patches/Add PHP 8.1 compatibility to laminas/laminas-code...

HANG
and on and on

Unlike @daenu I don’t have another server to install on; so I can’t use Concrete!

1 Like

You can use Concrete without Composer. You can download the latest version here: Download :: Concrete CMS - Org

Thank you, that’s helpful. I’ll use that for now.

what is the output of which patch?

Looking closer at my machine, it looks like patch is included with MacOS (I had been searching with Brew before). I get:

% which patch
/usr/bin/patch
% patch --version
patch 2.0-12u11-Apple

That’s exactly what happened here too. I installed that gpatch too.

I really hope, someone can help here.

It’s not only with installing Concrete with composer but with any other package

Just to rule out some possible problems, are you running anything in a Docker container in this process? Or as another user?

Nothing in a docker. My environment is brew based, so nothing on the root user

I know I’ve run into this in the past, but I’m struggling to remember what the root cause is.

For workarounds, in addition to just downloading an archive, if you needed to use Composer but didn’t have access to a server like @skote , you could create the project in a temporary Docker container with a local directory mounted as a volume like

docker run --rm -it --volume $PWD:/app --workdir /app composer:latest composer --ignore-platform-reqs create-project concretecms/composer my_new_project