language icon indicating copy to clipboard operation
language copied to clipboard

Analysis in language repo fails

Open eernstg opened this issue 1 year ago • 7 comments

See this log.

Excerpt from log
Run dart analyze --fatal-infos .
Analyzing ....

  error - working/macros/dart_model/testing/benchmark/lib/json_macro/scratch.macro.dart:3:1 - The part-of directive must be the only directive in a part. Try removing the other directives, or moving them to the library for which this is a part. - non_part_of_directive_in_part
  error - working/macros/example/bin/data_class_main.macro.dart:3:1 - The part-of directive must be the only directive in a part. Try removing the other directives, or moving them to the library for which this is a part. - non_part_of_directive_in_part
  error - working/macros/example/bin/data_class_main.macro.dart:4:1 - The part-of directive must be the only directive in a part. Try removing the other directives, or moving them to the library for which this is a part. - non_part_of_directive_in_part
  error - working/macros/example/bin/json_serializable_main.macro.dart:3:1 - The part-of directive must be the only directive in a part. Try removing the other directives, or moving them to the library for which this is a part. - non_part_of_directive_in_part
  error - working/macros/example/bin/json_serializable_main.macro.dart:4:1 - The part-of directive must be the only directive in a part. Try removing the other directives, or moving them to the library for which this is a part. - non_part_of_directive_in_part
  error - working/macros/example/bin/observable_main.macro.dart:3:1 - The part-of directive must be the only directive in a part. Try removing the other directives, or moving them to the library for which this is a part. - non_part_of_directive_in_part

6 issues found.
Error: Process completed with exit code 3.

An issue with working/macros/dart_model/testing/benchmark/lib/json_macro/scratch.macro.dart seems to cause language repo PRs to report "Some checks were not successful".

@jakemac53, does this look like an issue with json_macro, or would it be an analyzer issue?

eernstg avatar Aug 30 '24 19:08 eernstg

Cc @davidmorgan - also should we delete all the dart model stuff from here now?

jakemac53 avatar Aug 30 '24 20:08 jakemac53

Since https://github.com/dart-lang/sdk/commit/2c77c6749d0e74fd1467b069cf64cc36bb78b125 it looks like macros need the "enhanced-parts" experiment to run in the analyzer, here is a PR adding it so the examples pass again: https://github.com/dart-lang/language/pull/4072

davidmorgan avatar Sep 02 '24 07:09 davidmorgan

And indeed, delete dart_model from the language repo: https://github.com/dart-lang/language/pull/4073

davidmorgan avatar Sep 02 '24 08:09 davidmorgan

Looks like CI is still (or again) failing: https://github.com/dart-lang/language/actions/runs/11263974170/job/31323025779?pr=4126

munificent avatar Oct 10 '24 01:10 munificent

That looks like an analyzer bug; enhanced parts are enabled so non_part_of_directive_in_part doesn't make sense.

Speaking of not making sense, I don't think it makes sense that we continue to maintain an e2e test for the analyzer here ;)

@jakemac53 we could move them to dart-lang/macros/v1_example, what do you think please? It actually does kinda make sense in that repo to check v1 functionality for the same SDK version we're testing with v2.

davidmorgan avatar Oct 10 '24 10:10 davidmorgan

The issue here is that enhanced parts wasn't given an experimental release version, so the new SDK requires a language version of 3.7.

However, I am working on a CL to give it an experimental release version of 3.6 which should resolve things.

jakemac53 avatar Oct 10 '24 15:10 jakemac53

@jakemac53 we could move them to dart-lang/macros/v1_example, what do you think please? It actually does kinda make sense in that repo to check v1 functionality for the same SDK version we're testing with v2.

I don't have any strong opinions here really, once we have v2 actually working I would be very happy to just migrate everything to that.

jakemac53 avatar Oct 10 '24 15:10 jakemac53

This looks to be resolved

jakemac53 avatar Nov 11 '24 18:11 jakemac53