Open vasilich6107 opened 1 year ago
I need a minimal reproducible example this.
Without one, it isn't clear what's happening and could very well be an issue with build_runner or something else.
Will try to get one. But the error is pretty random. I have a hope that anyone could share the link with existing issue on github from build runner)
Got the same here:
[WARNING] No actions completed for 2m 15s, waiting on:
- freezed on lib/core/types/failures.dart
- freezed on lib/core/types/success.dart
- freezed on lib/core/models/track.dart
- freezed on lib/core/core_binding.dart
- freezed on lib/core/bindings.dart
.. and 11 more
freezed: ^2.1.0
Example for failure.dart
:
part '../../generated/core/types/failures.freezed.dart';
@Freezed(makeCollectionsUnmodifiable: false)
class Failure with _$Failure {
const factory Failure.server({
required StackTrace stacktrace,
}) = ServerFailure;
const factory Failure.local({
required StackTrace stacktrace,
}) = LocalFailure;
const factory Failure.generic({
required StackTrace stacktrace,
}) = GenericFailure;
[...] (5 more methods)
}
My build.yaml
builders:
freezed:
options:
build_extensions: {
'lib/features/{{}}.dart': 'lib/generated/features/{{}}.freezed.dart',
'lib/core/{{}}.dart': 'lib/generated/core/{{}}.freezed.dart',
}
I finally find why it's taking so much time. My success.dart
file has multi methods factory (~120 factories). It's seems that after 100 methods the build freeze during multiples minutes. But after splitting the file into multiple files the build come back to only 1min. So freezed got a maximum methods per class maybe ?
Describe the bug While using codegen I'm getting warnings in terminal
No actions completed for 21.1s, waiting on
I have monorepo with dozen of packages so if I have 10 of this warnings it costs me +200 sec of pipeline run
To Reproduce I do not have clear reproduction steps.
Expected behavior No delays for 20 second