From 684ee7b2c8ee5ae4ea9d224994d07c6ee45f9fac Mon Sep 17 00:00:00 2001 From: ZhuchkaTriplesix Date: Sun, 11 Oct 2026 18:07:04 +0300 Subject: [PATCH] fix(release): macOS build without SwiftPM, ext tester from a pure-Dart package The 0.4.19 Release run failed in two places, both new since 0.4.18 (the Flutter pin moved from 3.41.6 to 3.47.1 and the tester jobs were added): - Build macOS: Flutter 3.47's Swift Package Manager integration cannot resolve the vendored refresh_rate plugin ('target refresh_rate is outside the package root': Package.swift points at ../Classes). The app opts out of SwiftPM, so macOS builds use CocoaPods as before. - Build querya-ext-tester (4 platforms): 'dart compile' does not support build hooks, and the app's graph has sqlite3 and objective_c. The tester is pure Dart, so scripts/ci/build_ext_tester.sh compiles it from a throwaway package that holds lib/core/extensions and depends on path. --- .github/workflows/release.yml | 4 +++- pubspec.yaml | 5 +++++ scripts/ci/build_ext_tester.sh | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100755 scripts/ci/build_ext_tester.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 44af14e4..cdf190dd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -404,7 +404,9 @@ jobs: mkdir -p build/ext-tester EXE=querya-ext-tester if [ "${{ runner.os }}" = "Windows" ]; then EXE=querya-ext-tester.exe; fi - dart compile exe bin/querya_ext_tester.dart -o "build/ext-tester/$EXE" + # Pure Dart in a throwaway package: `dart compile exe` rejects the + # app's graph (build hooks in sqlite3 and objective_c). + scripts/ci/build_ext_tester.sh "build/ext-tester/$EXE" MCP=querya-mcp if [ "${{ runner.os }}" = "Windows" ]; then MCP=querya-mcp.exe; fi mkdir -p build/mcp diff --git a/pubspec.yaml b/pubspec.yaml index 642b4d9e..34e61a67 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -60,6 +60,11 @@ dependency_overrides: flutter: uses-material-design: true + config: + # The vendored refresh_rate plugin's Package.swift points its target at + # ../Classes, outside the package root, so Swift Package Manager (on by + # default since Flutter 3.47) cannot resolve it; macOS builds use CocoaPods. + enable-swift-package-manager: false assets: - assets/images/ - assets/themes/ diff --git a/scripts/ci/build_ext_tester.sh b/scripts/ci/build_ext_tester.sh new file mode 100755 index 00000000..9fac212e --- /dev/null +++ b/scripts/ci/build_ext_tester.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +# Compiles querya-ext-tester to one static executable. +# +# scripts/ci/build_ext_tester.sh build/ext-tester/querya-ext-tester +# +# `dart compile exe` refuses a package graph that has build hooks (sqlite3, +# objective_c), and the app's graph has them. The tester itself is pure Dart +# (lib/core/extensions + `package:path`), so it is built from a throwaway +# package that is named like the app, holds only lib/core/extensions and +# depends on `path`. Run it from the repository root; the output path is +# relative to it. +set -euo pipefail + +OUT="${1:?usage: build_ext_tester.sh }" +WORK="build/ext-tester-src" + +rm -rf "$WORK" +mkdir -p "$WORK/lib/core" "$WORK/bin" "$(dirname "$OUT")" +cp -R lib/core/extensions "$WORK/lib/core/extensions" +cp bin/querya_ext_tester.dart "$WORK/bin/querya_ext_tester.dart" + +cat > "$WORK/pubspec.yaml" <<'YAML' +name: querya_desktop +description: Throwaway package that builds querya-ext-tester (see scripts/ci/build_ext_tester.sh). +publish_to: none +environment: + sdk: '>=3.5.0 <4.0.0' +dependencies: + path: ^1.9.0 +YAML + +# The work directory is two levels below the repository root. +(cd "$WORK" && dart pub get && dart compile exe bin/querya_ext_tester.dart -o "../../$OUT") +rm -rf "$WORK"