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

[ffigen] Add config ignore-source-errors #810

Merged
merged 19 commits into from
Nov 21, 2023

Conversation

mannprerak2
Copy link
Contributor

Closes #439

  • Added config ignore-source-errors and flag --ignore-source-errors to prevent generation of errors.
  • Updated version, changelog, readme

  • I’ve reviewed the contributor guide and applied the relevant portions to this PR.
Contribution guidelines:

Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.

@mannprerak2 mannprerak2 marked this pull request as ready for review November 18, 2023 13:12
@mannprerak2
Copy link
Contributor Author

mannprerak2 commented Nov 18, 2023

@dcharkes this should be ready for review.

Regarding the failing windows test, since we are calling exit() it causes the entire test suite to be killed. It's probably some header error in one of the tests, but I'm not sure which.

I can run the tests twice and add some logs to figure out which test will fail. But to avoid these situations, is there any sort of work around for this? Can we maybe replace the calls to exit() with something else?

Copy link

github-actions bot commented Nov 19, 2023

Package publishing

Package Version Status Publish tag (post-merge)
package:ffigen 11.0.0 ready to publish ffigen-v11.0.0
package:native_toolchain_c 0.3.2 already published at pub.dev
package:jni 0.8.0-wip WIP (no publish necessary)
package:native_assets_cli 0.3.2 already published at pub.dev
package:jnigen 0.8.0-wip WIP (no publish necessary)
package:native_assets_builder 0.3.0 already published at pub.dev

Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.

@coveralls
Copy link

coveralls commented Nov 19, 2023

Coverage Status

coverage: 91.746% (-6.4%) from 98.152%
when pulling 3aa6561 on mannprerak2:ffigen_severe_compiler_logs
into 5dca10e on dart-lang:main.

Copy link
Collaborator

@dcharkes dcharkes left a comment

Choose a reason for hiding this comment

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

Thanks @mannprerak2!

pkgs/ffigen/CHANGELOG.md Outdated Show resolved Hide resolved
@@ -1,3 +1,10 @@
## 10.1.0

- Any compiler errors/warnings in source header files will now result in
Copy link
Collaborator

Choose a reason for hiding this comment

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

What kind of warnings result in wrong generated code? Should we refuse to generate on all warnings?
If we refuse to generate for too many warnings, people might just start using ignore-source-errors instead of fixing the issues.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True, for now I've only handled warnings/errors from libclang. (Excluding ObjC for now)

But I think anything which can potentially generate invalid bindings, that might silently break at runtime should be covered.

pkgs/ffigen/lib/src/header_parser/data.dart Outdated Show resolved Hide resolved
pkgs/ffigen/lib/src/header_parser/parser.dart Outdated Show resolved Hide resolved
* Add errors.md

* refer to errors.md

* Update errors.md

* Update errors.md

* Update errors.md
pkgs/ffigen/errors.md Outdated Show resolved Hide resolved
* Rename pkgs/ffigen/errors.md to pkgs/ffigen/docs/errors.md

* Update parser.dart
Rename pkgs/ffigen/errors.md to pkgs/ffigen/doc/errors.md
pkgs/ffigen/doc/errors.md Outdated Show resolved Hide resolved
```yaml
compiler-opts:
- "-I/path/to/folder"
```
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we mention -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/?

@liamappelbe what are typical errors we see with Objective-C?

pkgs/ffigen/doc/errors.md Show resolved Hide resolved
pkgs/ffigen/lib/src/header_parser/parser.dart Outdated Show resolved Hide resolved
pkgs/ffigen/tool/libclang_config.yaml Show resolved Hide resolved
* Update errors.md

* Update parser.dart

* Update errors.md
pkgs/ffigen/CHANGELOG.md Outdated Show resolved Hide resolved
* Update CHANGELOG.md

* Update pubspec.yaml
Copy link

auto-submit bot commented Nov 21, 2023

auto label is removed for dart-lang/native/810, due to This PR has not met approval requirements for merging. You are not a member of dart-team and need 1 more review(s) in order to merge this PR.

  • Merge guidelines: You need at least one approved review if you are already part of flutter-hackers or two member reviews if you are not a flutter-hacker before re-applying the autosubmit label. Reviewers: If you left a comment approving, please use the "approve" review action instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prevent generating and delete generated file on any [SEVERE] Errors
3 participants