From 19d7ce5fad7c7ef74ae1d682c9df124dcda19791 Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Thu, 10 Oct 2024 13:53:25 -0700 Subject: [PATCH 01/10] Run CI on Dart 3 --- .github/workflows/dart_ci.yml | 13 ++++++++++--- tool/delete_dart_2_only_files.sh | 11 +++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) create mode 100755 tool/delete_dart_2_only_files.sh diff --git a/.github/workflows/dart_ci.yml b/.github/workflows/dart_ci.yml index f81db64a..58995f78 100644 --- a/.github/workflows/dart_ci.yml +++ b/.github/workflows/dart_ci.yml @@ -15,17 +15,24 @@ jobs: strategy: fail-fast: false matrix: - # Can't run on `stable` (Dart 3) until we're fully null-safe. - sdk: [2.19.6] + sdk: [2.19.6, 3.4.4, main] steps: - uses: actions/checkout@v2 - - uses: dart-lang/setup-dart@v1 + - id: setup-dart + uses: dart-lang/setup-dart@v1 with: sdk: ${{ matrix.sdk }} - name: Print Dart SDK version run: dart --version + - name: Delete Dart-2-only files when running on Dart 3 + run: | + DART_VERSION="${{ steps.setup-dart.outputs.dart-version }}" + if [[ "$DART_VERSION" =~ ^3 ]]; then + ./tool/delete_dart_2_only_files.sh + fi + - id: install name: Install dependencies run: dart pub get diff --git a/tool/delete_dart_2_only_files.sh b/tool/delete_dart_2_only_files.sh new file mode 100755 index 00000000..299f8ac1 --- /dev/null +++ b/tool/delete_dart_2_only_files.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +# +# This script deletes files that can only be run in Dart 2 (ones not using null-safety), +# and need to be deleted for analysis and compilation to work in Dart 3. +# + +set -e + +rm test/nullable_callback_detection/non_null_safe_refs.dart +rm test/nullable_callback_detection/nullable_callback_detection_unsound_test.dart \ No newline at end of file From e5b4567d96cff3a4b172574f5f3d18467f3e1f5a Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Thu, 10 Oct 2024 13:58:52 -0700 Subject: [PATCH 02/10] Widen build_web_compilers to be able to build in Dart 3 --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index b5dd2a74..ed71453f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,7 +11,7 @@ dev_dependencies: args: ^2.0.0 build_runner: ^2.1.2 build_test: ^2.1.3 - build_web_compilers: ^3.0.0 + build_web_compilers: ">=3.0.0 <5.0.0" dart_dev: ^4.0.0 dependency_validator: ^3.2.2 glob: ^2.0.0 From 70889f18babdf608cba057946fa9cb9224b597d5 Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Thu, 10 Oct 2024 14:35:19 -0700 Subject: [PATCH 03/10] Use Dart stable (main used by mistake) --- .github/workflows/dart_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dart_ci.yml b/.github/workflows/dart_ci.yml index 58995f78..0c414ab8 100644 --- a/.github/workflows/dart_ci.yml +++ b/.github/workflows/dart_ci.yml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - sdk: [2.19.6, 3.4.4, main] + sdk: [2.19.6, 3.4.4, stable] steps: - uses: actions/checkout@v2 - id: setup-dart From 69be666c924d00a4712644bd283728fdd5785dd9 Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Thu, 10 Oct 2024 14:36:16 -0700 Subject: [PATCH 04/10] Increase test timeout --- .github/workflows/dart_ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dart_ci.yml b/.github/workflows/dart_ci.yml index 0c414ab8..cde6b939 100644 --- a/.github/workflows/dart_ci.yml +++ b/.github/workflows/dart_ci.yml @@ -53,13 +53,13 @@ jobs: run: | dart run build_runner test --delete-conflicting-outputs -- --preset dartdevc if: always() && steps.install.outcome == 'success' - timeout-minutes: 5 + timeout-minutes: 8 - name: Run tests (dart2js) run: | dart run build_runner test --delete-conflicting-outputs --release -- --preset dart2js if: always() && steps.install.outcome == 'success' - timeout-minutes: 5 + timeout-minutes: 8 - uses: anchore/sbom-action@v0 with: path: ./ From 8d43397b4a4d90e69c2613a6192539454333dbd0 Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Thu, 10 Oct 2024 16:54:17 -0700 Subject: [PATCH 05/10] Add 3.2.6 to matrix --- .github/workflows/dart_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dart_ci.yml b/.github/workflows/dart_ci.yml index cde6b939..276c8eaf 100644 --- a/.github/workflows/dart_ci.yml +++ b/.github/workflows/dart_ci.yml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - sdk: [2.19.6, 3.4.4, stable] + sdk: [2.19.6, 3.2.6, 3.4.4, stable] steps: - uses: actions/checkout@v2 - id: setup-dart From 407b6b1a99e062d8cfef7dfe25b03f5a5058607c Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Mon, 14 Oct 2024 17:40:45 -0700 Subject: [PATCH 06/10] Work around test hanging issue --- dart_test.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dart_test.yaml b/dart_test.yaml index d5effb76..62b2c40f 100644 --- a/dart_test.yaml +++ b/dart_test.yaml @@ -4,6 +4,9 @@ platforms: - chrome - vm +# Work around process handing after tests finish: https://github.com/dart-lang/build/issues/3765 +concurrency: 1 + presets: dart2js-legacy: exclude_tags: no-dart2js From 1944a07e6bec5c2988d668622584dfaebbcd6a79 Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Tue, 15 Oct 2024 19:23:18 -0700 Subject: [PATCH 07/10] Only run SBOM action once --- .github/workflows/dart_ci.yml | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/workflows/dart_ci.yml b/.github/workflows/dart_ci.yml index 276c8eaf..47f34680 100644 --- a/.github/workflows/dart_ci.yml +++ b/.github/workflows/dart_ci.yml @@ -10,6 +10,23 @@ on: - '**' jobs: + # Run as a separate job outside the Dart SDK matrix below, + # since we can only emit a single SBOM. + create-sbom-release-asset: + name: Create SBOM Release Asset + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: dart-lang/setup-dart@v1 + with: + sdk: 2.19.6 # This version doesn't matter so long as it resolves. + - run: dart pub get + - name: Publish SBOM to Release Assets + uses: anchore/sbom-action@v0 + with: + path: ./ + format: cyclonedx-json + build: runs-on: ubuntu-latest strategy: @@ -59,8 +76,4 @@ jobs: run: | dart run build_runner test --delete-conflicting-outputs --release -- --preset dart2js if: always() && steps.install.outcome == 'success' - timeout-minutes: 8 - - uses: anchore/sbom-action@v0 - with: - path: ./ - format: cyclonedx-json + timeout-minutes: 8 \ No newline at end of file From 6ef4d7c5f4e9c36fe1dcb4a3608fe36f317e4a88 Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Tue, 15 Oct 2024 19:23:43 -0700 Subject: [PATCH 08/10] Dial back matrix to only run on latest Dart 3 version --- .github/workflows/dart_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dart_ci.yml b/.github/workflows/dart_ci.yml index 47f34680..0058fa84 100644 --- a/.github/workflows/dart_ci.yml +++ b/.github/workflows/dart_ci.yml @@ -32,7 +32,7 @@ jobs: strategy: fail-fast: false matrix: - sdk: [2.19.6, 3.2.6, 3.4.4, stable] + sdk: [2.19.6, stable] steps: - uses: actions/checkout@v2 - id: setup-dart From 69dfdea9b9215e995a4b668463e0833c19ad4f7a Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Tue, 15 Oct 2024 19:27:59 -0700 Subject: [PATCH 09/10] Fix typo --- .github/workflows/dart_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dart_ci.yml b/.github/workflows/dart_ci.yml index 0058fa84..f39be8ce 100644 --- a/.github/workflows/dart_ci.yml +++ b/.github/workflows/dart_ci.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: dart-lang/setup-dart@v1 + - uses: dart-lang/setup-dart@v1 with: sdk: 2.19.6 # This version doesn't matter so long as it resolves. - run: dart pub get From bd958dc6cbe280d19b316a2f434c26b0d9cca098 Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Tue, 15 Oct 2024 19:34:32 -0700 Subject: [PATCH 10/10] Officially support Dart 3 in SDK constraint --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index ed71453f..0a30a10b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ version: 7.2.0 description: Bindings of the ReactJS library for building interactive interfaces. homepage: https://github.com/cleandart/react-dart environment: - sdk: '>=2.13.0 <3.0.0' + sdk: '>=2.13.0 <4.0.0' dependencies: js: ^0.6.3 meta: ^1.6.0