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

Problem with Restyler Job #2460226 #190

Closed
woody-apple opened this issue Nov 2, 2022 · 1 comment
Closed

Problem with Restyler Job #2460226 #190

woody-apple opened this issue Nov 2, 2022 · 1 comment

Comments

@woody-apple
Copy link

Hi there-

I'm having a problem with a Restyled Job

What I expected to happen:
Restyle completes

What happened instead:
Fails with an error

@pbrisbin
Copy link
Member

pbrisbin commented Nov 2, 2022

Hi there-

Exited 137 indicates an out-of-memory scenario. It seems clang-format is being run on the following 38 files,

"examples/darwin-framework-tool/commands/clusters/ClusterCommandBridge.h"
"examples/darwin-framework-tool/commands/clusters/ModelCommandBridge.mm"
"examples/darwin-framework-tool/commands/clusters/ReportCommandBridge.h"
"examples/darwin-framework-tool/commands/clusters/WriteAttributeCommandBridge.h"
"examples/darwin-framework-tool/commands/pairing/OpenCommissioningWindowCommand.mm"
"examples/darwin-framework-tool/commands/pairing/PairingCommandBridge.mm"
"examples/darwin-framework-tool/commands/provider/OTAProviderDelegate.h"
"examples/darwin-framework-tool/commands/provider/OTAProviderDelegate.mm"
"examples/darwin-framework-tool/commands/tests/TestCommandBridge.h"
"src/darwin/Framework/CHIP/MTRAttributeCacheContainer.h"
"src/darwin/Framework/CHIP/MTRAttributeCacheContainer.mm"
"src/darwin/Framework/CHIP/MTRBaseDevice.h"
"src/darwin/Framework/CHIP/MTRBaseDevice.mm"
"src/darwin/Framework/CHIP/MTRCallbackBridgeBase_internal.h"
"src/darwin/Framework/CHIP/MTRCluster.h"
"src/darwin/Framework/CHIP/MTRControllerFactory.mm"
"src/darwin/Framework/CHIP/MTRDevice.h"
"src/darwin/Framework/CHIP/MTRDevice.mm"
"src/darwin/Framework/CHIP/MTRDeviceController+XPC.h"
"src/darwin/Framework/CHIP/MTRDeviceController.h"
"src/darwin/Framework/CHIP/MTRDeviceController.mm"
"src/darwin/Framework/CHIP/MTRDeviceController_Internal.h"
"src/darwin/Framework/CHIP/MTRDeviceOverXPC.h"
"src/darwin/Framework/CHIP/MTRDeviceOverXPC.m"
"src/darwin/Framework/CHIP/MTROTAProviderDelegate.h"
"src/darwin/Framework/CHIP/MTROTAProviderDelegateBridge.mm"
"src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h"
"src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm"
"src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge_internal.h"
"src/darwin/Framework/CHIP/zap-generated/MTRClusters.h"
"src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm"
"src/darwin/Framework/CHIPTests/MTRControllerTests.m"
"src/darwin/Framework/CHIPTests/MTRDeviceTests.m"
"src/darwin/Framework/CHIPTests/MTRTestOTAProvider.m"
"src/darwin/Framework/CHIPTests/MTRXPCListenerSampleTests.m"
"src/darwin/Framework/CHIPTests/MTRXPCProtocolTests.m"
"zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h"
"zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h"

And it's requiring more memory than we allow individual Restylers to consume to do so.

If you'd like to continue investigating why the memory consumption is too high, I can offer some commands to run. However, it's possible we'll find that clang-format itself (which we can't control) is just hungry for memory on this set of files and the limit is what it is. Let me know if you'd like to proceed down this path.

I can also offer some workarounds:

You could break up the PR such that fewer files are touched at once. I wouldn't do this just to satisfy Restyled, but often it's a Good Thing to do anyway, as it results in more isolated changes that are easier to review and safer to deploy.

Do all of these files need to be maintained by Restyled? I'm wondering of "examples" or "_generated" are things we can exclude from clang-format, especially if they are large files.

Related, are any of these files just massive and likely the cause of the memory consumption? If so, excluding that file may be an acceptable trade-off.

It's also possible a newer version of clang-format exists, which would behave better in this regard. If so, I'd be happy to update, just let me know your findings.

Hope this helps.

@pbrisbin pbrisbin closed this as completed Nov 3, 2022
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