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

Serialization of 'WeakMap' is not allowed #1792

Closed
Eduardo-Morales-Alberti opened this issue Feb 6, 2023 · 3 comments
Closed

Serialization of 'WeakMap' is not allowed #1792

Eduardo-Morales-Alberti opened this issue Feb 6, 2023 · 3 comments
Labels
Milestone

Comments

@Eduardo-Morales-Alberti
Copy link

Error on git hook using grumphp after update to 2.9.0.
Error message:

Serialization of 'WeakMap' is not allowed

PHP version: 8.1.9
Grumphp version: v1.5.1

I know that the information is not enough. Could you give me an explanation of what information should I post here?

@Eduardo-Morales-Alberti
Copy link
Author

I also created an issue on monolog, because I am not sure if it is an issue of monolog or grumphp.

@Eduardo-Morales-Alberti
Copy link
Author

Seems like related to the serialization of the log by the module grumphp phpro/grumphp#1065

@Eduardo-Morales-Alberti
Copy link
Author

To run processes in parallel, we use amphp/parallel in combination with serializable-closure.
This serializable-closure is serializing the context of the closure, which might include the logger.

For example, the git_commit_message here will have a dependency to gitonomy, which is configured with a logger (monolog).
Therefore, the serializable-closure will try to serialize both gitonomy and monolog into it's context.
It's not like we are actively willing to serialize the logger in there, but it's part of the dependency tree.

Originally posted by @veewee in phpro/grumphp#1065 (comment)

@Seldaek Seldaek added this to the 2.x milestone Feb 6, 2023
@Seldaek Seldaek closed this as completed in 2ae0444 Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants