Skip to content

Upgrading ffigen 1 to 2

Breaking1.2.0 → 2.4.2Breaking5Deprecated1New12Changed7Fixed10Other1

BreakingUpgrade verdict

4 breaking changes.

  • Some internal objects now compare by value, which means they can no longer be used in compile-time constant maps or sets.
  • The tool no longer uses the flag that turned off sound null safety.
  • FFIgen no longer has a separate setup step. Instead, you can optionally point it at your LLVM library folder with a new setting.
  • The package now uses Dart's null safety, but in unsound mode, so callers may need to update their Dart SDK and dependencies.
Top 4 of 5 that need code or config changes

Dart SDK requirement changed in 2.1.0: >=2.7.0 <3.0.0 → >=2.12.0 <3.0.0.

Breaking4
Overrides == and hashCode in OS, Architecture, and Sanitizer, so these objects can no longer be keys of const maps and sets.
OSArchitectureSanitizerOS.nameArchitecture.name
Removes the usage of the --no-sound-null-safety flag.
--no-sound-null-safety
Removes the FFIgen setup phase and adds an optional llvm-lib config key to specify the path to the llvm/lib folder.
llvm-lib
Migrates ffigen to unsound null safety.
Deprecated1
Deprecates the llvm-lib config key.
llvm-lib