[ffigen] Fail fast when generating Objective-C bindings on non-macOS hosts
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
Research direction
Read pkgs/ffigen/lib/src/header_parser/parser.dart at the two cited locations and pkgs/ffigen/lib/src/config_provider/utils.dart to trace the xcrun --show-sdk-path call. First reproduce the uncaught ProcessException on a non-macOS host with ObjectiveC(...) configured. Done means Objective-C generation reports a clear macOS requirement instead of crashing.
Written by the indexing model from the issue text.
Description
parser.dart (and lines 181-184) unconditionally runs xcrun --show-sdk-path via firstLineOfStdout (utils.dart) with no Platform.isMacOS check whenever ObjectiveC(...) is configured.
On Linux/Windows this crashes with an uncaught ProcessException trying to run xcrun. Instead we should fail fast with a clear error explaining that Objective-C generation requires macOS.
It's theoretically possible to support ObjC on Linux (maybe windows?) with a custom SDK and sysroot, but that would be a much bigger job, and I don't know of any users who need that.
Context: https://github.com/dart-lang/native/issues/3837
Note: This bug is AI generated. I've reviewed it and it makes sense, but I haven't attempted to repro. Make sure the bug repros before trying to fix it.
- Dominant language
- Dart
- Stars
- 280
- Forks
- 166
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 35
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dart-lang/native
-
lang-java needs-triage package:jni package:jni_flutter package:jnigen
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 2 days
-
lang-java needs-triage package:jni package:jni_flutter package:jnigen
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 2 days
-
lang-java needs-triage package:jni package:jni_flutter package:jnigen
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
Maintainers usually reply within 2 days
-
needs-triage package:ffigen
Difficulty 1/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 2 days
-
needs-triage package:hooks_runner
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 2 days
All issues in dart-lang/native
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
finamp-app/finamp#1920 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 1/5 Under an hour Newbie friendliness 83/100
Maintainers usually reply within 1 day
-
package:skills
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
act.await-dev-pr co.request d.new-feature dev.flavors e1-hours p2-medium st.blocked t.cli-tools target.web
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
flutter/website#14165 · 1 comment ·
Maintainers usually reply within 1 day