Closed mmcdon20 closed 1 year ago
@mmcdon20 It seems CI on this PR fails, on Dart/solution_1 to be precise. This is the relevant snippet of the logs:
#7 [build 1/6] FROM docker.io/library/dart:3.0.0@sha256:36cca0cee57b7f49a5fd1d47ab4bad4dec48b650aac4013b6c9d9a6f0f0a4755
#7 extracting sha256:c352dfb67360115842446d4b692ae59647ad60ab7782acf9c4e34b43437df004
#7 extracting sha256:c352dfb67360115842446d4b692ae59647ad60ab7782acf9c4e34b43437df004 6.3s done
#7 DONE 9.9s
#10 [build 2/6] WORKDIR /app
#10 DONE 0.9s
#11 [build 3/6] COPY pubspec.* ./
#11 DONE 0.0s
#12 [build 4/6] RUN pub get
#12 0.112 /bin/sh: 1: pub: not found
#12 ERROR: process "/bin/sh -c pub get" did not complete successfully: exit code: 127
------
> [build 4/6] RUN pub get:
#12 0.112 /bin/sh: 1: pub: not found
------
Dockerfile:4
--------------------
2 | WORKDIR /app
3 | COPY pubspec.* ./
4 | >>> RUN pub get
5 | COPY . .
6 | RUN pub get --offline \
--------------------
ERROR: failed to solve: process "/bin/sh -c pub get" did not complete successfully: exit code: 127
Error: buildx failed with: ERROR: failed to solve: process "/bin/sh -c pub get" did not complete successfully: exit code: 127
They changed the command to dart pub get
instead of pub get
, sorry about that. Updated the dockerfile accordingly.
That's ok. I didn't have to figure this out myself, CI did all the hard work there. :)
Description
Updates the dart solutions to dart 3.
The core solution is the same, but I did update the parallel code in the following ways.
The result from the
work
function is now aRecord
instead of aMap
. This has better type safety and it is no longer necessary to do a typecast, for examplemessage['passes'] as int
can now be written asmessage.passes
.I am now using
Isolate.run
instead ofIsolate.spawn
. Withspawn
you had to create aReceivePort
in order to send the result back from the spawned isolate,run
is a newer api that simply returns the result as aFuture
without the need to create aReceivePort
, which simplifies the code somewhat.Contributing requirements
drag-race
as the target branch.