From c98c5a1c4e026cbdb7a613f7e58fe111f6a220c0 Mon Sep 17 00:00:00 2001 From: Gold87 <91761103+Gold872@users.noreply.github.com> Date: Mon, 18 Aug 2025 14:05:41 -0400 Subject: [PATCH 1/4] Upgrade Dart to 3.9.0 --- .github/workflows/analyze.yaml | 2 +- .github/workflows/burt_network.yaml | 2 +- .github/workflows/setup.yaml | 2 +- burt_network/pubspec.yaml | 2 +- pubspec.yaml | 2 +- subsystems/pubspec.yaml | 4 ++-- video/pubspec.yaml | 4 ++-- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/analyze.yaml b/.github/workflows/analyze.yaml index 599d9d8b..a97d8309 100644 --- a/.github/workflows/analyze.yaml +++ b/.github/workflows/analyze.yaml @@ -17,7 +17,7 @@ jobs: - name: Install Dart uses: dart-lang/setup-dart@v1 with: - sdk: 3.6.0 + sdk: 3.9.0 - name: Install dependencies run: dart pub get diff --git a/.github/workflows/burt_network.yaml b/.github/workflows/burt_network.yaml index 2a809cd8..2c245a23 100644 --- a/.github/workflows/burt_network.yaml +++ b/.github/workflows/burt_network.yaml @@ -24,7 +24,7 @@ jobs: - name: Install Dart uses: dart-lang/setup-dart@v1 with: - sdk: 3.6.0 + sdk: 3.9.0 - name: Install dependencies run: dart pub get diff --git a/.github/workflows/setup.yaml b/.github/workflows/setup.yaml index e74d83c0..093f4ea4 100644 --- a/.github/workflows/setup.yaml +++ b/.github/workflows/setup.yaml @@ -26,7 +26,7 @@ jobs: - name: Install Dart uses: dart-lang/setup-dart@v1 with: - sdk: 3.6.0 + sdk: 3.9.0 - name: Run setup script run: dart run :rover --verbose diff --git a/burt_network/pubspec.yaml b/burt_network/pubspec.yaml index 6962622c..d647a5d0 100644 --- a/burt_network/pubspec.yaml +++ b/burt_network/pubspec.yaml @@ -6,7 +6,7 @@ repository: https://github.com/BinghamtonRover/Networking resolution: workspace environment: - sdk: ^3.6.0 + sdk: ^3.9.0 # Add regular dependencies here. dependencies: diff --git a/pubspec.yaml b/pubspec.yaml index 8c254b2e..f58ebf22 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: rover publish_to: none environment: - sdk: ^3.6.0 + sdk: ^3.9.0 workspace: - autonomy diff --git a/subsystems/pubspec.yaml b/subsystems/pubspec.yaml index c928fcf2..463c202f 100644 --- a/subsystems/pubspec.yaml +++ b/subsystems/pubspec.yaml @@ -5,7 +5,7 @@ publish_to: none resolution: workspace environment: - sdk: ^3.6.0 + sdk: ^3.9.0 # Add regular dependencies here. dependencies: @@ -17,4 +17,4 @@ dependencies: osc: ^1.0.0 dev_dependencies: - ffigen: ^16.0.0 + ffigen: ^19.1.0 diff --git a/video/pubspec.yaml b/video/pubspec.yaml index 3847cb4a..2c05a098 100644 --- a/video/pubspec.yaml +++ b/video/pubspec.yaml @@ -5,7 +5,7 @@ publish_to: none resolution: workspace environment: - sdk: ^3.6.0 + sdk: ^3.9.0 # Add regular dependencies here. dependencies: @@ -16,7 +16,7 @@ dependencies: dartcv4: ^1.1.4 dev_dependencies: - ffigen: ^16.0.0 + ffigen: ^19.1.0 test: ^1.21.0 very_good_analysis: ^6.0.0 From 9d1734298ae642e3325156795a839b4fe3dbdde2 Mon Sep 17 00:00:00 2001 From: Gold87 <91761103+Gold872@users.noreply.github.com> Date: Mon, 18 Aug 2025 14:52:45 -0400 Subject: [PATCH 2/4] Re-run ffigen --- .../lib/src/generated/can_ffi_bindings.dart | 203 +++++++++--------- 1 file changed, 104 insertions(+), 99 deletions(-) diff --git a/subsystems/lib/src/generated/can_ffi_bindings.dart b/subsystems/lib/src/generated/can_ffi_bindings.dart index 54367d49..44e2d285 100644 --- a/subsystems/lib/src/generated/can_ffi_bindings.dart +++ b/subsystems/lib/src/generated/can_ffi_bindings.dart @@ -11,62 +11,59 @@ import 'package:ffi/ffi.dart' as pkg_ffi; class CanBindings { /// Holds the symbol lookup function. final ffi.Pointer Function(String symbolName) - _lookup; + _lookup; /// The symbols are looked up in [dynamicLibrary]. CanBindings(ffi.DynamicLibrary dynamicLibrary) - : _lookup = dynamicLibrary.lookup; + : _lookup = dynamicLibrary.lookup; /// The symbols are looked up with [lookup]. CanBindings.fromLookup( - ffi.Pointer Function(String symbolName) - lookup) - : _lookup = lookup; + ffi.Pointer Function(String symbolName) lookup, + ) : _lookup = lookup; ffi.Pointer BurtCan_create( - ffi.Pointer interface1, + ffi.Pointer interface$, int readTimeout, BurtCanType type, ) { - return _BurtCan_create( - interface1, - readTimeout, - type.value, - ); + return _BurtCan_create(interface$, readTimeout, type.value); } - late final _BurtCan_createPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Int32, - ffi.UnsignedInt)>>('BurtCan_create'); - late final _BurtCan_create = _BurtCan_createPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int, int)>(); - - void BurtCan_free( - ffi.Pointer pointer, - ) { - return _BurtCan_free( - pointer, - ); + late final _BurtCan_createPtr = + _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Int32, + ffi.UnsignedInt, + ) + > + >('BurtCan_create'); + late final _BurtCan_create = + _BurtCan_createPtr.asFunction< + ffi.Pointer Function(ffi.Pointer, int, int) + >(); + + void BurtCan_free(ffi.Pointer pointer) { + return _BurtCan_free(pointer); } late final _BurtCan_freePtr = _lookup)>>( - 'BurtCan_free'); + 'BurtCan_free', + ); late final _BurtCan_free = _BurtCan_freePtr.asFunction)>(); - BurtCanStatus BurtCan_open( - ffi.Pointer pointer, - ) { - return BurtCanStatus.fromValue(_BurtCan_open( - pointer, - )); + BurtCanStatus BurtCan_open(ffi.Pointer pointer) { + return BurtCanStatus.fromValue(_BurtCan_open(pointer)); } - late final _BurtCan_openPtr = _lookup< - ffi.NativeFunction)>>( - 'BurtCan_open'); + late final _BurtCan_openPtr = + _lookup< + ffi.NativeFunction)> + >('BurtCan_open'); late final _BurtCan_open = _BurtCan_openPtr.asFunction)>(); @@ -74,47 +71,52 @@ class CanBindings { ffi.Pointer pointer, ffi.Pointer message, ) { - return BurtCanStatus.fromValue(_BurtCan_send( - pointer, - message, - )); + return BurtCanStatus.fromValue(_BurtCan_send(pointer, message)); } - late final _BurtCan_sendPtr = _lookup< - ffi.NativeFunction< - ffi.UnsignedInt Function(ffi.Pointer, - ffi.Pointer)>>('BurtCan_send'); - late final _BurtCan_send = _BurtCan_sendPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + late final _BurtCan_sendPtr = + _lookup< + ffi.NativeFunction< + ffi.UnsignedInt Function( + ffi.Pointer, + ffi.Pointer, + ) + > + >('BurtCan_send'); + late final _BurtCan_send = + _BurtCan_sendPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer) + >(); BurtCanStatus BurtCan_receive( ffi.Pointer pointer, ffi.Pointer message, ) { - return BurtCanStatus.fromValue(_BurtCan_receive( - pointer, - message, - )); + return BurtCanStatus.fromValue(_BurtCan_receive(pointer, message)); } - late final _BurtCan_receivePtr = _lookup< - ffi.NativeFunction< - ffi.UnsignedInt Function(ffi.Pointer, - ffi.Pointer)>>('BurtCan_receive'); - late final _BurtCan_receive = _BurtCan_receivePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - BurtCanStatus BurtCan_close( - ffi.Pointer pointer, - ) { - return BurtCanStatus.fromValue(_BurtCan_close( - pointer, - )); + late final _BurtCan_receivePtr = + _lookup< + ffi.NativeFunction< + ffi.UnsignedInt Function( + ffi.Pointer, + ffi.Pointer, + ) + > + >('BurtCan_receive'); + late final _BurtCan_receive = + _BurtCan_receivePtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer) + >(); + + BurtCanStatus BurtCan_close(ffi.Pointer pointer) { + return BurtCanStatus.fromValue(_BurtCan_close(pointer)); } - late final _BurtCan_closePtr = _lookup< - ffi.NativeFunction)>>( - 'BurtCan_close'); + late final _BurtCan_closePtr = + _lookup< + ffi.NativeFunction)> + >('BurtCan_close'); late final _BurtCan_close = _BurtCan_closePtr.asFunction)>(); @@ -124,23 +126,25 @@ class CanBindings { late final _NativeCanMessage_createPtr = _lookup Function()>>( - 'NativeCanMessage_create'); - late final _NativeCanMessage_create = _NativeCanMessage_createPtr.asFunction< - ffi.Pointer Function()>(); - - void NativeCanMessage_free( - ffi.Pointer pointer, - ) { - return _NativeCanMessage_free( - pointer, - ); + 'NativeCanMessage_create', + ); + late final _NativeCanMessage_create = + _NativeCanMessage_createPtr.asFunction< + ffi.Pointer Function() + >(); + + void NativeCanMessage_free(ffi.Pointer pointer) { + return _NativeCanMessage_free(pointer); } - late final _NativeCanMessage_freePtr = _lookup< - ffi.NativeFunction)>>( - 'NativeCanMessage_free'); - late final _NativeCanMessage_free = _NativeCanMessage_freePtr.asFunction< - void Function(ffi.Pointer)>(); + late final _NativeCanMessage_freePtr = + _lookup< + ffi.NativeFunction)> + >('NativeCanMessage_free'); + late final _NativeCanMessage_free = + _NativeCanMessage_freePtr.asFunction< + void Function(ffi.Pointer) + >(); late final addresses = _SymbolAddresses(this); } @@ -149,10 +153,11 @@ class _SymbolAddresses { final CanBindings _library; _SymbolAddresses(this._library); ffi.Pointer)>> - get BurtCan_free => _library._BurtCan_freePtr; + get BurtCan_free => _library._BurtCan_freePtr; ffi.Pointer< - ffi.NativeFunction)>> - get NativeCanMessage_free => _library._NativeCanMessage_freePtr; + ffi.NativeFunction)> + > + get NativeCanMessage_free => _library._NativeCanMessage_freePtr; } enum BurtCanType { @@ -163,10 +168,10 @@ enum BurtCanType { const BurtCanType(this.value); static BurtCanType fromValue(int value) => switch (value) { - 0 => CAN, - 1 => CANFD, - _ => throw ArgumentError("Unknown value for BurtCanType: $value"), - }; + 0 => CAN, + 1 => CANFD, + _ => throw ArgumentError('Unknown value for BurtCanType: $value'), + }; } /// No 0 value to ensure we always set a status @@ -193,19 +198,19 @@ enum BurtCanStatus { const BurtCanStatus(this.value); static BurtCanStatus fromValue(int value) => switch (value) { - 1 => OK, - 2 => SOCKET_CREATE_ERROR, - 3 => INTERFACE_PARSE_ERROR, - 4 => BIND_ERROR, - 5 => CLOSE_ERROR, - 6 => MTU_ERROR, - 7 => CANFD_NOT_SUPPORTED, - 8 => FD_MISC_ERROR, - 9 => WRITE_ERROR, - 10 => READ_ERROR, - 11 => FRAME_NOT_FULLY_READ, - _ => throw ArgumentError("Unknown value for BurtCanStatus: $value"), - }; + 1 => OK, + 2 => SOCKET_CREATE_ERROR, + 3 => INTERFACE_PARSE_ERROR, + 4 => BIND_ERROR, + 5 => CLOSE_ERROR, + 6 => MTU_ERROR, + 7 => CANFD_NOT_SUPPORTED, + 8 => FD_MISC_ERROR, + 9 => WRITE_ERROR, + 10 => READ_ERROR, + 11 => FRAME_NOT_FULLY_READ, + _ => throw ArgumentError('Unknown value for BurtCanStatus: $value'), + }; } final class NativeCanMessage extends ffi.Struct { From cefeb344ad65a942e6f454c1fa6a1587af766223 Mon Sep 17 00:00:00 2001 From: Gold87 <91761103+Gold872@users.noreply.github.com> Date: Mon, 18 Aug 2025 15:00:58 -0400 Subject: [PATCH 3/4] Add CI checks for formatting --- .github/workflows/analyze.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/analyze.yaml b/.github/workflows/analyze.yaml index a97d8309..e5ec1f9d 100644 --- a/.github/workflows/analyze.yaml +++ b/.github/workflows/analyze.yaml @@ -25,5 +25,17 @@ jobs: - name: Analyze code run: dart analyze --fatal-infos + # - name: Check autonomy formatting + # run: dart format --output=none --set-exit-if-changed autonomy/* + + # - name: Check burt_network formatting + # run: dart format --output=none --set-exit-if-changed burt_network/* + + # - name: Check subsystems formatting + # run: dart format --output=none --set-exit-if-changed subsystems/* + + - name: Check video formatting + run: dart format --output=none --set-exit-if-changed video/* + # - name: Validate dependencies # run: dart run dependency_validator From 6fcf4949d9c067569556a9d99cfcb7c770838713 Mon Sep 17 00:00:00 2001 From: Gold87 <91761103+Gold872@users.noreply.github.com> Date: Mon, 18 Aug 2025 15:05:42 -0400 Subject: [PATCH 4/4] Fix directories to check --- .github/workflows/analyze.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/analyze.yaml b/.github/workflows/analyze.yaml index e5ec1f9d..791bec97 100644 --- a/.github/workflows/analyze.yaml +++ b/.github/workflows/analyze.yaml @@ -26,16 +26,16 @@ jobs: run: dart analyze --fatal-infos # - name: Check autonomy formatting - # run: dart format --output=none --set-exit-if-changed autonomy/* + # run: dart format --output=none --set-exit-if-changed autonomy/bin/* autonomy/lib/* autonomy/test/* # - name: Check burt_network formatting - # run: dart format --output=none --set-exit-if-changed burt_network/* + # run: dart format --output=none --set-exit-if-changed burt_network/bin/* burt_network/lib/* burt_network/test/* # - name: Check subsystems formatting - # run: dart format --output=none --set-exit-if-changed subsystems/* + # run: dart format --output=none --set-exit-if-changed subsystems/bin/* subsystems/lib/* - name: Check video formatting - run: dart format --output=none --set-exit-if-changed video/* + run: dart format --output=none --set-exit-if-changed video/bin/* video/lib/* # - name: Validate dependencies # run: dart run dependency_validator