Skip to content

Commit 684ee7b

Browse files
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.
1 parent 4247ab7 commit 684ee7b

3 files changed

Lines changed: 42 additions & 1 deletion

File tree

‎.github/workflows/release.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,9 @@ jobs:
404404
mkdir -p build/ext-tester
405405
EXE=querya-ext-tester
406406
if [ "${{ runner.os }}" = "Windows" ]; then EXE=querya-ext-tester.exe; fi
407-
dart compile exe bin/querya_ext_tester.dart -o "build/ext-tester/$EXE"
407+
# Pure Dart in a throwaway package: `dart compile exe` rejects the
408+
# app's graph (build hooks in sqlite3 and objective_c).
409+
scripts/ci/build_ext_tester.sh "build/ext-tester/$EXE"
408410
MCP=querya-mcp
409411
if [ "${{ runner.os }}" = "Windows" ]; then MCP=querya-mcp.exe; fi
410412
mkdir -p build/mcp

‎pubspec.yaml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ dependency_overrides:
6060

6161
flutter:
6262
uses-material-design: true
63+
config:
64+
# The vendored refresh_rate plugin's Package.swift points its target at
65+
# ../Classes, outside the package root, so Swift Package Manager (on by
66+
# default since Flutter 3.47) cannot resolve it; macOS builds use CocoaPods.
67+
enable-swift-package-manager: false
6368
assets:
6469
- assets/images/
6570
- assets/themes/

‎scripts/ci/build_ext_tester.sh‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env bash
2+
# Compiles querya-ext-tester to one static executable.
3+
#
4+
# scripts/ci/build_ext_tester.sh build/ext-tester/querya-ext-tester
5+
#
6+
# `dart compile exe` refuses a package graph that has build hooks (sqlite3,
7+
# objective_c), and the app's graph has them. The tester itself is pure Dart
8+
# (lib/core/extensions + `package:path`), so it is built from a throwaway
9+
# package that is named like the app, holds only lib/core/extensions and
10+
# depends on `path`. Run it from the repository root; the output path is
11+
# relative to it.
12+
set -euo pipefail
13+
14+
OUT="${1:?usage: build_ext_tester.sh <output-file, relative to the repo root>}"
15+
WORK="build/ext-tester-src"
16+
17+
rm -rf "$WORK"
18+
mkdir -p "$WORK/lib/core" "$WORK/bin" "$(dirname "$OUT")"
19+
cp -R lib/core/extensions "$WORK/lib/core/extensions"
20+
cp bin/querya_ext_tester.dart "$WORK/bin/querya_ext_tester.dart"
21+
22+
cat > "$WORK/pubspec.yaml" <<'YAML'
23+
name: querya_desktop
24+
description: Throwaway package that builds querya-ext-tester (see scripts/ci/build_ext_tester.sh).
25+
publish_to: none
26+
environment:
27+
sdk: '>=3.5.0 <4.0.0'
28+
dependencies:
29+
path: ^1.9.0
30+
YAML
31+
32+
# The work directory is two levels below the repository root.
33+
(cd "$WORK" && dart pub get && dart compile exe bin/querya_ext_tester.dart -o "../../$OUT")
34+
rm -rf "$WORK"

0 commit comments

Comments
 (0)