Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

fix: download arch-specific bun binaries for macOS, bump app to v2.2.294

Louis Beaumont9e8fc7d173c2
diff --git a/Cargo.lock b/Cargo.lock
index ebebca44c..2be637824 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -6717,7 +6717,7 @@ dependencies = [
[[package]]
name = "screenpipe-audio"
-version = "0.3.242"
+version = "0.3.243"
dependencies = [
"anyhow",
"audiopipe",
@@ -6777,7 +6777,7 @@ dependencies = [
[[package]]
name = "screenpipe-config"
-version = "0.3.242"
+version = "0.3.243"
dependencies = [
"dirs 6.0.0",
"serde",
@@ -6790,7 +6790,7 @@ dependencies = [
[[package]]
name = "screenpipe-connect"
-version = "0.3.242"
+version = "0.3.243"
dependencies = [
"anyhow",
"async-trait",
@@ -6817,7 +6817,7 @@ dependencies = [
[[package]]
name = "screenpipe-core"
-version = "0.3.242"
+version = "0.3.243"
dependencies = [
"accessibility",
"accessibility-sys",
@@ -6862,7 +6862,7 @@ dependencies = [
[[package]]
name = "screenpipe-db"
-version = "0.3.242"
+version = "0.3.243"
dependencies = [
"anyhow",
"chrono",
@@ -6888,7 +6888,7 @@ dependencies = [
[[package]]
name = "screenpipe-engine"
-version = "0.3.242"
+version = "0.3.243"
dependencies = [
"anyhow",
"async-trait",
@@ -6958,7 +6958,7 @@ dependencies = [
[[package]]
name = "screenpipe-events"
-version = "0.3.242"
+version = "0.3.243"
dependencies = [
"anyhow",
"chrono",
@@ -6976,7 +6976,7 @@ dependencies = [
[[package]]
name = "screenpipe-screen"
-version = "0.3.242"
+version = "0.3.243"
dependencies = [
"accessibility-sys",
"anyhow",
@@ -7016,7 +7016,7 @@ dependencies = [
[[package]]
name = "screenpipe-vault"
-version = "0.3.242"
+version = "0.3.243"
dependencies = [
"argon2",
"chacha20poly1305",
diff --git a/apps/screenpipe-app-tauri/scripts/pre_build.js b/apps/screenpipe-app-tauri/scripts/pre_build.js
index 77a8cea19..f1d0f942c 100644
--- a/apps/screenpipe-app-tauri/scripts/pre_build.js
+++ b/apps/screenpipe-app-tauri/scripts/pre_build.js
@@ -180,38 +180,47 @@ async function copyBunBinary() {
}
return;
} else if (platform === 'macos') {
- const possibleBunPaths = [
- path.join(os.homedir(), '.bun', 'bin', 'bun'),
- ];
+ bunDest1 = path.join(cwd, 'bun-aarch64-apple-darwin');
+ bunDest2 = path.join(cwd, 'bun-x86_64-apple-darwin');
- // Try to find bun via `which`
- try {
- const whichBun = (await $`which bun`.text()).trim();
- if (whichBun) {
- possibleBunPaths.unshift(whichBun);
- }
- } catch {
- // which failed, rely on default paths
+ if (await fs.exists(bunDest1) && await fs.exists(bunDest2)) {
+ console.log('bun binaries already exist for both macOS architectures.');
+ return;
}
- bunSrc = null;
- for (const possiblePath of possibleBunPaths) {
- try {
- await fs.access(possiblePath);
- console.log('found bun at:', possiblePath);
- bunSrc = possiblePath;
- break;
- } catch {
+ // Download arch-specific bun binaries so both Intel and Apple Silicon Macs
+ // get a native binary (previously the build-machine's bun was copied to both
+ // paths, causing "Bad CPU type in executable" on the other architecture).
+ const bunVersion = '1.3.10';
+ const archMap = [
+ { url: `https://github.com/oven-sh/bun/releases/download/bun-v${bunVersion}/bun-darwin-aarch64.zip`, dest: bunDest1, label: 'aarch64' },
+ { url: `https://github.com/oven-sh/bun/releases/download/bun-v${bunVersion}/bun-darwin-x64.zip`, dest: bunDest2, label: 'x64' },
+ ];
+
+ for (const { url, dest, label } of archMap) {
+ if (await fs.exists(dest)) {
+ console.log(`bun ${label} binary already exists, skipping download.`);
continue;
}
+ console.log(`downloading bun v${bunVersion} for macOS ${label}...`);
+ const tmpZip = path.join(cwd, `bun-darwin-${label}.zip`);
+ const tmpDir = path.join(cwd, `bun-darwin-${label}-tmp`);
+ try {
+ await $`curl -L -o ${tmpZip} ${url}`;
+ await $`unzip -o ${tmpZip} -d ${tmpDir}`;
+ // The zip contains a folder like bun-darwin-aarch64/bun or bun-darwin-x64/bun
+ const entries = await fs.readdir(tmpDir);
+ const extractedBun = path.join(tmpDir, entries[0], 'bun');
+ await copyFile(extractedBun, dest);
+ console.log(`bun ${label} binary installed to ${dest}`);
+ await fs.rm(tmpZip, { force: true });
+ await fs.rm(tmpDir, { recursive: true, force: true });
+ } catch (error) {
+ console.error(`failed to download bun ${label}:`, error);
+ process.exit(1);
+ }
}
-
- if (!bunSrc) {
- throw new Error('Could not find bun binary. Please check if bun is installed correctly');
- }
-
- bunDest1 = path.join(cwd, 'bun-aarch64-apple-darwin');
- bunDest2 = path.join(cwd, 'bun-x86_64-apple-darwin');
+ return;
}
if (await fs.exists(bunDest1)) {
@@ -223,11 +232,6 @@ async function copyBunBinary() {
await fs.access(bunSrc);
await copyFile(bunSrc, bunDest1);
console.log(`bun binary copied successfully from ${bunSrc} to ${bunDest1}`);
-
- if (platform === 'macos') {
- await copyFile(bunSrc, bunDest2);
- console.log(`bun binary also copied to ${bunDest2}`);
- }
} catch (error) {
console.error('failed to copy bun binary:', error);
console.error('source path:', bunSrc);
diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
index 2238fcecc..f5fa2e73b 100644
--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
@@ -9640,7 +9640,7 @@ dependencies = [
[[package]]
name = "screenpipe-app"
-version = "2.2.291"
+version = "2.2.292"
dependencies = [
"anyhow",
"arboard",
@@ -9742,7 +9742,7 @@ dependencies = [
[[package]]
name = "screenpipe-audio"
-version = "0.3.242"
+version = "0.3.243"
dependencies = [
"anyhow",
"audiopipe",
@@ -9797,7 +9797,7 @@ dependencies = [
[[package]]
name = "screenpipe-config"
-version = "0.3.242"
+version = "0.3.243"
dependencies = [
"dirs 6.0.0",
"serde",
@@ -9809,7 +9809,7 @@ dependencies = [
[[package]]
name = "screenpipe-connect"
-version = "0.3.242"
+version = "0.3.243"
dependencies = [
"anyhow",
"async-trait",
@@ -9836,7 +9836,7 @@ dependencies = [
[[package]]
name = "screenpipe-core"
-version = "0.3.242"
+version = "0.3.243"
dependencies = [
"accessibility",
"accessibility-sys",
@@ -9880,7 +9880,7 @@ dependencies = [
[[package]]
name = "screenpipe-db"
-version = "0.3.242"
+version = "0.3.243"
dependencies = [
"anyhow",
"chrono",
@@ -9905,7 +9905,7 @@ dependencies = [
[[package]]
name = "screenpipe-engine"
-version = "0.3.242"
+version = "0.3.243"
dependencies = [
"anyhow",
"async-trait",
@@ -9968,7 +9968,7 @@ dependencies = [
[[package]]
name = "screenpipe-events"
-version = "0.3.242"
+version = "0.3.243"
dependencies = [
"anyhow",
"chrono",
@@ -9984,7 +9984,7 @@ dependencies = [
[[package]]
name = "screenpipe-screen"
-version = "0.3.242"
+version = "0.3.243"
dependencies = [
"accessibility-sys",
"anyhow",
@@ -10020,7 +10020,7 @@ dependencies = [
[[package]]
name = "screenpipe-vault"
-version = "0.3.242"
+version = "0.3.243"
dependencies = [
"argon2",
"chacha20poly1305",
diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml b/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
index 16fed31e2..af46b4806 100644
--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "screenpipe-app"
-version = "2.2.293"
+version = "2.2.294"
description = "24/7 memory for your desktop. 100% local."
authors = ["you"]
license = ""