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

comment with {@code} causes build_runner to crash #3827

Closed
dickermoshe opened this issue Feb 5, 2025 · 1 comment · Fixed by #3828
Closed

comment with {@code} causes build_runner to crash #3827

dickermoshe opened this issue Feb 5, 2025 · 1 comment · Fixed by #3828
Assignees
Labels
type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@dickermoshe
Copy link
Contributor

dickermoshe commented Feb 5, 2025

There seems to be a bug in build_runner that any comment which contains this throws an error:

/// {@}
class A{}

/// {@hello}
class A{}

/// {@hello hi}
class A{}

Any comment with this will cause build_runner to give up:

[SEVERE] embed on lib/src/tz/android/bindings.dart:

This builder requires Dart inputs without syntax errors.
However, package:dateutil/src/tz/android/bindings.dart (or an existing part) contains the following errors.

Try fixing the errors and re-running the build.

[INFO] Running build completed, took 2.0s
[INFO] Caching finalized dependency graph completed, took 34ms

This is particularly troubling because jnigen put's many comments like this in the code because that's what java code has.

The error which is emitted is
/dateutil/lib/src/tz/android/bindings.dart(6..10): Doc directive 'hello' is unknown.

  • Dart SDK version: 3.6.1 (stable) (Tue Jan 7 09:50:00 2025 -0800) on "windows_x64"
  • build_runner 2.4.14
  • Issue exists on Linux an Windows

pubspec.yaml

name: dateutil
description: A starting point for Dart libraries or applications.
version: 1.0.0
# repository: https://github.com/my_org/my_repo

environment:
  sdk: ^3.6.1

dependencies:
  b: ^0.2.0
  collection: ^1.19.1
  embed_annotation: ^1.2.1
  equatable: ^2.0.7
  ffi: ^2.1.3
  jni: ^0.14.0
  meta: ^1.16.0
  path: ^1.9.1

dev_dependencies:
  build_runner: ^2.4.14
  embed: ^1.4.0
  ffigen: ^16.1.0
  jnigen: ^0.14.0
  lints: ^5.0.0
  melos: ^6.3.2
  test: ^1.24.0
@dickermoshe dickermoshe added the type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) label Feb 5, 2025
@dickermoshe dickermoshe changed the title Bulid runner reporting non existing syntax error comment with {@code} causes build_runner to crash Feb 6, 2025
@davidmorgan davidmorgan self-assigned this Feb 6, 2025
@davidmorgan
Copy link
Contributor

Thanks! Commented on the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants