Skip to content

Commit 168e2b5

Browse files
committed
build: multi channel install test
1 parent 9fbd2e4 commit 168e2b5

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

docs/agents/binary-distribution.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,10 @@ vp check
6262
| 矩阵变更未通知脚本方 | 装错 arch / 永久失败 |
6363
| webhook 配错当发版失败 | 不应;webhook 失败只 warn |
6464
|`Bun.build({ compile })` 代替 CLI | Bun ≤1.2.19 可能 exit 0 但不写 outfile → `sha256` ENOENT |
65+
| 编译后未 `chmod` windows `.exe` | Bun 1.2.19 在 Unix 上写出 mode `000``sha256` / upload `EACCES` |
6566

6667
## 编译实现注意
6768

6869
- `binary-compile.mjs` 必须走 **`bun build --compile --outfile …`**,不要用 `Bun.build({ compile })`(CI 钉 `1.2.19` 时 API 会假成功)。
6970
- 编译后校验 outfile 存在再算 SHA256。
71+
- 每个产物在哈希前 `chmod 0755`(规避 Bun 1.2.19 windows cross-compile 无权限,见 oven-sh/bun#21308)。

tools/release/lib/binary-build.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* --mode channel → writes <channel>.json only (does not touch latest.json)
1111
*/
1212
import { createHash } from "node:crypto";
13-
import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
13+
import { chmodSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
1414
import { join, resolve } from "node:path";
1515
import { fileURLToPath } from "node:url";
1616
import { spawnSync } from "node:child_process";
@@ -154,6 +154,9 @@ function compileOne({ bunTarget, os, arch, exe }, version, outdir, entry) {
154154
}
155155
if (result.stdout) process.stdout.write(result.stdout);
156156
if (result.stderr) process.stderr.write(result.stderr);
157+
// Bun 1.2.19 writes windows-x64 .exe with mode 000 on Unix hosts (oven-sh/bun#21308).
158+
// chmod so sha256 / gh upload can open the file; harmless for other targets.
159+
chmodSync(outfile, 0o755);
157160
return { fileName, outfile, os, arch, sha256: sha256File(outfile) };
158161
}
159162

0 commit comments

Comments
 (0)