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

[pigeon] Remove heap allocation in generated C++ code #6196

Merged
merged 1 commit into from
Feb 28, 2024

Conversation

loic-sharma
Copy link
Member

@loic-sharma loic-sharma commented Feb 23, 2024

Please let me know if I goofed anything, this is my first time contributing to Pigeon!

Addresses flutter/flutter#144042

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@@ -1,7 +1,7 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Autogenerated from Pigeon, do not edit directly.
// Autogenerated from Pigeon (v17.0.0), do not edit directly.
Copy link
Member Author

@loic-sharma loic-sharma Feb 23, 2024

Choose a reason for hiding this comment

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

FYI, Pigeon also updated other platforms' comment to add a Pigeon version. I reverted the other platforms' changes to reduce noise.

Copy link
Contributor

Choose a reason for hiding this comment

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

This code should be created by running tool/generate.dart, which suppresses version output.

Copy link
Contributor

Choose a reason for hiding this comment

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

(Probably we need to do a pass over this package's CONTRIBUTING.md with updated info.)

Copy link
Member Author

@loic-sharma loic-sharma Feb 23, 2024

Choose a reason for hiding this comment

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

Ah, should I update this document then?

To update the generated code, run:
```sh
dart run pigeon --input pigeons/messages.dart
```

I did try tool/generate.dart but that hangs on my machine. I'll debug that...

Copy link
Member Author

@loic-sharma loic-sharma Feb 23, 2024

Choose a reason for hiding this comment

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

I updated the app's README and started a draft PR to fix the hang: #6198

# Set fallback configurations for older versions of the flutter tool.
if (NOT DEFINED FLUTTER_TARGET_PLATFORM)
set(FLUTTER_TARGET_PLATFORM "windows-x64")
endif()
Copy link
Member Author

Choose a reason for hiding this comment

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

The Flutter tool automatically does this migration to add Windows Arm64 support.

packages/pigeon/CHANGELOG.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
packages/pigeon/lib/cpp_generator.dart Show resolved Hide resolved
@@ -1,7 +1,7 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Autogenerated from Pigeon, do not edit directly.
// Autogenerated from Pigeon (v17.0.0), do not edit directly.
Copy link
Contributor

Choose a reason for hiding this comment

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

This code should be created by running tool/generate.dart, which suppresses version output.

auto-submit bot pushed a commit that referenced this pull request Feb 26, 2024
The Pigeon tool hangs on Windows if you don't have the Java formatter on your path. Repro examples:

```
dart ./tool/generate.dart
```

```
dart ./tool/test.dart -f windows_integration_tests
```

The root cause is that the tool runs sub-processes without consuming their stdout/stderr output. The sub-process blocks if these pipes get full. See: https://api.dart.dev/stable/3.3.0/dart-io/Process-class.html

This change is untested. See: #6198 (comment)

Needed for #6196

Part of flutter/flutter#144042
@loic-sharma
Copy link
Member Author

@stuartmorgan @tarrinneal Gentle reminder for review :)

Copy link
Contributor

@tarrinneal tarrinneal left a comment

Choose a reason for hiding this comment

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

If you could sync the latest changes, this all seems good to me.

@loic-sharma loic-sharma added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 28, 2024
@auto-submit auto-submit bot merged commit 5ff00b2 into flutter:main Feb 28, 2024
78 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Feb 29, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Feb 29, 2024
flutter/packages@353086c...6d02f03

2024-02-28 [email protected] Manual roll Flutter from c30f998 to d00bfe8 (32 revisions) (flutter/packages#6222)
2024-02-28 [email protected] [google_maps_flutter] Add `style` to widget (flutter/packages#6192)
2024-02-28 [email protected] Add library annotations for js interop (flutter/packages#6216)
2024-02-28 [email protected] [google_map_flutter] Add style to widget - platform impls (flutter/packages#6205)
2024-02-28 [email protected] [google_maps_flutter_web] Migrate to package:web (flutter/packages#5254)
2024-02-28 [email protected] [pigeon] Remove heap allocation in generated C++ code (flutter/packages#6196)
2024-02-27 [email protected] [pigeon] Allows kotlin generator to skip error class generation (flutter/packages#6183)
2024-02-27 [email protected] [camerax] Implements `setExposureMode` (flutter/packages#6110)
2024-02-27 [email protected] Roll Flutter from b77560e to c30f998 (12 revisions) (flutter/packages#6211)
2024-02-26 [email protected] Add `InkResponse`, `Material` and fix `Opacity` (flutter/packages#6199)
2024-02-26 [email protected] [url_launcher] Add explicit imports of UIKit (flutter/packages#6208)
2024-02-26 [email protected] [pigeon] Fix tool hangs on verbose sub-processes (flutter/packages#6198)
2024-02-26 [email protected] [tool] Ignore GeneratedPluginRegistrant.swift for `format` (flutter/packages#6195)
2024-02-26 [email protected] Roll Flutter from 1e8dd1e to b77560e (8 revisions) (flutter/packages#6207)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
LouiseHsu pushed a commit to LouiseHsu/packages that referenced this pull request Mar 7, 2024
The Pigeon tool hangs on Windows if you don't have the Java formatter on your path. Repro examples:

```
dart ./tool/generate.dart
```

```
dart ./tool/test.dart -f windows_integration_tests
```

The root cause is that the tool runs sub-processes without consuming their stdout/stderr output. The sub-process blocks if these pipes get full. See: https://api.dart.dev/stable/3.3.0/dart-io/Process-class.html

This change is untested. See: flutter#6198 (comment)

Needed for flutter#6196

Part of flutter/flutter#144042
LouiseHsu pushed a commit to LouiseHsu/packages that referenced this pull request Mar 7, 2024
Please let me know if I goofed anything, this is my first time contributing to Pigeon!

Addresses flutter/flutter#144042
arc-yong pushed a commit to Arctuition/packages-arc that referenced this pull request Jun 14, 2024
The Pigeon tool hangs on Windows if you don't have the Java formatter on your path. Repro examples:

```
dart ./tool/generate.dart
```

```
dart ./tool/test.dart -f windows_integration_tests
```

The root cause is that the tool runs sub-processes without consuming their stdout/stderr output. The sub-process blocks if these pipes get full. See: https://api.dart.dev/stable/3.3.0/dart-io/Process-class.html

This change is untested. See: flutter#6198 (comment)

Needed for flutter#6196

Part of flutter/flutter#144042
arc-yong pushed a commit to Arctuition/packages-arc that referenced this pull request Jun 14, 2024
Please let me know if I goofed anything, this is my first time contributing to Pigeon!

Addresses flutter/flutter#144042
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App p: pigeon platform-windows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants