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

Still stuck at "Performing replacements..." #86

Closed
sovetski opened this issue Mar 5, 2024 · 2 comments
Closed

Still stuck at "Performing replacements..." #86

sovetski opened this issue Mar 5, 2024 · 2 comments

Comments

@sovetski
Copy link

sovetski commented Mar 5, 2024

I just used the documentation's composer example, and it stuck at the "[info] Performing replacements..." step

Edit: I just got this error

The following exception is caused by a process timeout
Check https://getcomposer.org/doc/06-config.md#process-timeout for details

In Process.php line 1204:
                                                              
  The process "strauss" exceeded the timeout of 300 seconds.  

Very strange, I have only 1 dependency and it is very very slow...

My composer.json:

{
    "require": {        
        "aws/aws-sdk-php": "^3.257"
    },
    "require-dev": {
        "brianhenryie/strauss": "^0.16.0"
    },
    "scripts": {
        "prefix-namespaces": [
            "strauss"
        ],
        "post-install-cmd": [
            "@prefix-namespaces"
        ],
        "post-update-cmd": [
            "@prefix-namespaces"
        ]
    },
    "extra": {
        "strauss": {
            "namespace_prefix": "MyCustomTest\\",
            "classmap_prefix": "MyCustomTest_"
        }
    }
}
@BrianHenryIE
Copy link
Owner

BrianHenryIE commented Mar 6, 2024

The AWS SDK is enormous – it's 216,273 PHP files to require aws/aws-sdk-php. Their repo has instructions for Removing Unused Services. Then with fewer files, this tool should run in a reasonable time.

The timeout you're experiencing can be fixed by following the instructions linked in the error message, or running the tool directly with vendor/bin/strauss.

There's nothing here that's not working, per se.

$ date; vendor/bin/strauss; date
Wed Mar  6 14:22:13 PST 2024
[info] Loading config...
[info] Building dependency list...
[info] Enumerating files...
[info] Copying files...
[info] Determining changes...
[info] Performing replacements...
[info] Adding licenses...
[info] Generating autoloader...
[info] Cleaning up...
Wed Mar  6 14:27:40 PST 2024

There is a branch started with the idea of enumerating all changes before performing them. By taking that approach, it should be possible to remove some of the the loops in loops. In theory it should be O(n) – two passes over all the files.

@sovetski
Copy link
Author

sovetski commented Mar 7, 2024

Thanks @BrianHenryIE, Removing unused services was very helpful, it is very quick now, but I have another problem, I will create a new issue

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

No branches or pull requests

2 participants