Skip to content

[pigeon] Add option to ignore PigeonOptions in file when using the function runWithOptions #163159

Closed
flutter/packages
#8709

Description

@melvinotieno

Use case

I own a library that uses pigeon library directly specifically the command runWithOptions. This library makes it possible to use pigeon with build_runner, therefore I make use of ScratchSpace. The problem is that, if an input file has PigeonOptions, the scratch space paths are overwritten with those defined in the input file. I would like if the function runWithOptions would have a flag to turn off the ability to overwrite with the PigeonOptions in the input file. This is because in my library, I already use those options in the input file to generate the paths to the scratch space

Proposal

I can see the solution to this being done in two different ways:

Proposal A

The merging of options could be moved to the run function and those options passed to runWithOptions

Proposal B

Have a flag in the function to prevent the merging of the options and the following code https://github.com/flutter/packages/blob/09888cbc304b152e69f8cd98261580765afb4b9f/packages/pigeon/lib/src/pigeon_lib.dart#L2682-L2685 can be put within that flag such that if true, then merging of the options is done

static Future<int> runWithOptions(
    PigeonOptions options, {
    List<GeneratorAdapter>? adapters,
    String? sdkPath,
    bool injectOverflowTypes = false,
    bool flagToMergeOptions = true,
  }) async {

Activity

  1. added
    in triagePresently being triaged by the triage team
    c: new featureNothing broken; request for a new capability
    packageflutter/packages repository. See also p: labels.
    c: proposalA detailed proposal for a change to Flutter
    p: pigeonrelated to pigeon messaging codegen tool
    and removed
    in triagePresently being triaged by the triage team
    on Feb 13, 2025
  2. added
    P2Important issues not at the top of the work list
    on Feb 18, 2025
  3. added
    r: fixedIssue is closed as already fixed in a newer version
    on Mar 18, 2025
  4. github-actions commented on Apr 1, 2025

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  5. locked as resolved and limited conversation to collaborators on Apr 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterp: pigeonrelated to pigeon messaging codegen toolpackageflutter/packages repository. See also p: labels.r: fixedIssue is closed as already fixed in a newer versionteam-ecosystemOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions