GoogleCloudPlatform / functions-framework-dart

FaaS (Function as a service) framework for writing portable Dart functions
https://pub.dev/packages/functions_framework
Apache License 2.0
537 stars 54 forks source link

Update examples/raw_cloudevent to use official image #229

Closed subfuzion closed 3 years ago

subfuzion commented 3 years ago

Will need to take a look at builder framework internals for 'Iterable<Object?>', which does not match the return type, 'Iterable<Object>', of the overridden method, 'StructuredSerializer.serialize'

kevmoo commented 3 years ago

How do I reproduce this?

subfuzion commented 3 years ago

Update the Dockerfile like the other examples to use the official image, try and build.

subfuzion commented 3 years ago

I just looked at it again, looks like the current example probably hasn't been working for a while:

dart run build_runner build --delete-conflicting-outputs

Output:

$ dart run build_runner build --delete-conflicting-outputs
Precompiling executable... (5.4s)
Failed to precompile build_runner:build_runner:
...
subfuzion commented 3 years ago

This is the commit that breaks the example: 79e4e4fd (PR #219).

kevmoo commented 3 years ago

Have you run pub upgrade in the directory first? It's working fine for me...

On Mon, May 17, 2021 at 7:49 PM Tony Pujals @.***> wrote:

This is the commit that breaks the example: 79e4e4fd https://github.com/GoogleCloudPlatform/functions-framework-dart/commit/79e4e4fd82d2241bc03f80aa3dd7624de019b917 (PR #219 https://github.com/GoogleCloudPlatform/functions-framework-dart/pull/219 ).

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/GoogleCloudPlatform/functions-framework-dart/issues/229#issuecomment-842783893, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAEFCRA47RAJBOOQ7L4DQTTOHITDANCNFSM45BOCRFA .

subfuzion commented 3 years ago

I have. And the image doesn't build either, so that shouldn't be my environment. Anyway, why don't you just update the sample (as I originally asked) and if it works for you, then that's great. I updated the other samples.

subfuzion commented 3 years ago

So git clean fdx fixed the issue for me:

$ git clean -fdx
Removing .dart_tool/
Removing .packages
Removing pubspec.lock

But since the .dockerignore ensures that the first two weren't included in the docker build context, it seems that removing pubspec.lock is what needed to be done to fix.

So this makes me realize that we're versioning an application, but we're not committing the lock file.

I'll add the lock file with an update for the example. Otherwise, the fix is to run dart pub upgrade to force Dart to update it.

subfuzion commented 3 years ago

Reopening. Will close this with #230.