Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,8 @@ jobs:
run: |
cd binaries
SHA256_ARM64=$(sha256sum flutter-skill-macos-arm64/flutter-skill-macos-arm64 | cut -d' ' -f1)
SHA256_X64=$(sha256sum flutter-skill-macos-x64/flutter-skill-macos-x64 | cut -d' ' -f1)
SHA256_LINUX=$(sha256sum flutter-skill-linux-x64/flutter-skill-linux-x64 | cut -d' ' -f1)
echo "sha256_arm64=$SHA256_ARM64" >> $GITHUB_OUTPUT
echo "sha256_x64=$SHA256_X64" >> $GITHUB_OUTPUT
echo "sha256_linux=$SHA256_LINUX" >> $GITHUB_OUTPUT

- name: Checkout Homebrew tap
Expand All @@ -237,7 +235,6 @@ jobs:
run: |
VERSION=${{ needs.prepare.outputs.version }}
SHA256_ARM64=${{ steps.sha256.outputs.sha256_arm64 }}
SHA256_X64=${{ steps.sha256.outputs.sha256_x64 }}
SHA256_LINUX=${{ steps.sha256.outputs.sha256_linux }}

# Write the new formula
Expand All @@ -253,10 +250,6 @@ jobs:
url "https://github.com/ai-dashboad/flutter-skill/releases/download/vVERSION_PLACEHOLDER/flutter-skill-macos-arm64"
sha256 "SHA256_ARM64_PLACEHOLDER"
end
on_intel do
url "https://github.com/ai-dashboad/flutter-skill/releases/download/vVERSION_PLACEHOLDER/flutter-skill-macos-x64"
sha256 "SHA256_X64_PLACEHOLDER"
end
end

on_linux do
Expand Down Expand Up @@ -298,7 +291,6 @@ jobs:
# Replace placeholders
sed -i "s/VERSION_PLACEHOLDER/${VERSION}/g" homebrew-tap/Formula/flutter-skill.rb
sed -i "s/SHA256_ARM64_PLACEHOLDER/${SHA256_ARM64}/g" homebrew-tap/Formula/flutter-skill.rb
sed -i "s/SHA256_X64_PLACEHOLDER/${SHA256_X64}/g" homebrew-tap/Formula/flutter-skill.rb
sed -i "s/SHA256_LINUX_PLACEHOLDER/${SHA256_LINUX}/g" homebrew-tap/Formula/flutter-skill.rb

- name: Commit and push
Expand All @@ -319,9 +311,6 @@ jobs:
- os: macos-latest
arch: arm64
artifact: flutter-skill-macos-arm64
- os: macos-13
arch: x64
artifact: flutter-skill-macos-x64
- os: ubuntu-latest
arch: x64
artifact: flutter-skill-linux-x64
Expand Down
8 changes: 4 additions & 4 deletions packaging/homebrew/flutter-skill.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ class FlutterSkill < Formula
license "MIT"

# Platform-specific native binaries
# Intel macOS (x64) has no native binary: GitHub retired the macos-13 hosted
# runner used to build it, and current x64 runner images require a paid
# large-runner tier. Intel Mac users should install via npm/pub.dev instead,
# which fall back to the Dart runtime automatically.
on_macos do
on_arm do
url "https://github.com/ai-dashboad/flutter-skill/releases/download/v0.9.36/flutter-skill-macos-arm64"
sha256 "PLACEHOLDER_ARM64_SHA256"
end
on_intel do
url "https://github.com/ai-dashboad/flutter-skill/releases/download/v0.9.36/flutter-skill-macos-x64"
sha256 "PLACEHOLDER_X64_SHA256"
end
end

on_linux do
Expand Down
21 changes: 19 additions & 2 deletions packaging/npm/bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,25 @@ function runNativeBinary(binaryPath) {
args.push('server');
}

const server = spawn(binaryPath, args, {
stdio: 'inherit'
// spawn() reports launch failures (ENOEXEC, EACCES, ENOENT, wrong-arch, ...)
// inconsistently across platforms/Node versions: some surface synchronously
// as a thrown exception from spawn() itself, others only asynchronously via
// the 'error' event. Without handling both, the failure is uncaught and
// crashes the process instead of ever reaching the Dart fallback.
let server;
try {
server = spawn(binaryPath, args, {
stdio: 'inherit'
});
} catch (err) {
console.error(`[flutter-skill] Native binary failed to launch (${err.code || err.message}), falling back to Dart runtime`);
runWithDart();
return;
}

server.on('error', (err) => {
console.error(`[flutter-skill] Native binary failed to launch (${err.code || err.message}), falling back to Dart runtime`);
runWithDart();
});

server.on('close', (code) => {
Expand Down