Skip to content

[ffigen] 22.1.0 removed defaultCompilerOpts in a minor release, breaking swiftgen 0.2.0 #3723

Description

@QuncCccccc

ffigen 22.1.0 (published 2026-10-01) removed defaultCompilerOpts from the public API (CHANGELOG: "Removed defaultCompilerOpts from the public API, since it is now redundant and was always a hack."). The latest swiftgen (0.2.0) still calls it and allows ffigen: ^22.0.0, so any fresh resolve of swiftgen now fails to compile:

swiftgen-0.2.0/lib/src/generator.dart:101:17: Error: Method not found: 'defaultCompilerOpts'.
          ...fg.defaultCompilerOpts(logger),
                ^^^^^^^^^^^^^^^^^^^

This broke flutter/packages CI, since pigeon uses swiftgen for its FFI/Swift interop generation (e.g. this build). We're pinning ffigen <22.1.0 in pigeon's dev_dependencies as a workaround; the PR will link back here.

Repro: any package that depends on swiftgen: ^0.2.0; run dart pub upgrade (resolves ffigen 22.1.0), then compile anything that imports package:swiftgen/swiftgen.dart. Pinning ffigen: ">=22.0.0 <22.1.0" makes it compile again.

Possible fixes:

  • Publish a swiftgen release that no longer uses defaultCompilerOpts (e.g. uses Input.appendCompilerOptions) and requires ffigen ^22.1.0, and/or
  • Publish ffigen 22.1.1 that restores defaultCompilerOpts (deprecated), or retract ffigen 22.1.0.

Since removing a public API is a breaking change, it would be good for future removals like this to go out in a major version.

Activity

  1. added
    P1A high priority bug; for example, a single project is unusable or has many test failures
    on Oct 1, 2026
  2. dcharkes commented on Oct 1, 2026

    @dcharkes
    Collaborator
    • or retract ffigen 22.1.0.

    Retracted to turn CIs green again.

    @liamappelbe could you look at republishing?

  3. self-assigned this
    on Oct 1, 2026
  4. removed their assignment
    on Oct 1, 2026
  5. liamappelbe commented on Oct 1, 2026

    @liamappelbe
    Contributor

    Oops. I'll republish as a major version

  6. dcharkes commented on Oct 6, 2026

    @dcharkes
    Collaborator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1A high priority bug; for example, a single project is unusable or has many test failures

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions