Repository navigation
Conversation
5 of 6 tasks
liamappelbe
reviewed
Sep 21, 2026
Contributor
Author
|
Closing in favor of #3673 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This is an alternative to #3673. Only one of the two should be merged: #3673 widens the
cli_utilconstraint, while this PR removes the dependency altogether.Description
ffigencurrently depends oncli_util: ^0.4.2, while newer tooling has moved on tocli_util0.5 and 0.6. For example, everymelos8 release requirescli_util >=0.5.0, so a package can't have bothffigenandmelosin itsdev_dependencies. Since Melos 7,meloshas to be a dev dependency in the workspace root, so any Flutter FFI plugin that uses Melos currently can't keepffigenas a dev dependency.The only thing
ffigenuses fromcli_utilis theAnsiclass, and only for three escape codes: green for the success messages, red for severe log lines in the executable, and the reset code. Rather than widening the constraint, this PR removes the dependency, soffigencan't clash with other tools overcli_utilagain:lib/src/logger.dartgetsansiGreenandansiRedhelpers, which use the same terminal check asAnsi.terminalSupportsAnsi(stdout.supportsAnsiEscapesand stdout being a terminal) and the same escape codes as before.lib/src/ffigen.dartandlib/src/executables/ffigen.dartuse those helpers instead ofAnsi.test/header_parser_tests/dart_handle_test.dartusedsdkPathfromcli_utilto find the SDK include directory. It now derives it from ffigen's owndartExecutablehelper.example/shared_bindingsdeclaredcli_utilwithout using it, so it is removed there too.I ran
dart analyzeon the package and onexample/shared_bindings, and rantest/header_parser_tests/dart_handle_test.dart,test/config_testsandtest/unit_tests. Everything passes except the twosdk_variables_test.darttests, which fail on my machine becausexcruncan't find the iOS SDK. I also ran theffigenexecutable in a pseudo terminal to confirm that the success message is still printed in green.Related Issues
Alternative to #3673.
PR Checklist
dart tool/ci.dart --alllocally and resolved all issues identified. This ensures the PR is formatted, has no lint errors, and ran all code generators. This applies to the packages part of the toplevelpubspec.yamlworkspace. (ffigenis not part of the top level workspace yet. I randart formatanddart analyzeon the package directly.)CHANGELOG.mdfor the relevant packages. (Not needed for small changes such as doc typos).22.0.1-wip.)