Skip to content

ci(desktop-release): run the dependency install step under bash on Windows - #12423

Closed
yiliang114 wants to merge 1 commit into
mainfrom
ci/desktop-release-windows-shell
Closed

yiliang114 wants to merge 1 commit into
mainfrom
ci/desktop-release-windows-shell

Conversation

@yiliang114

Copy link
Copy Markdown
Collaborator

What this PR does

Declares shell: 'bash' on the Install Qwen Code dependencies step of the desktop release workflow, so the Windows build runs that step's bash conditional under Git Bash instead of handing it to pwsh. Three lines, no other change.

Why it's needed

The step body became bash in #11859 (the pnpm switch). This workflow has no defaults.run block — unlike ci.yml, which is exactly why the same snippet is safe there — and each of its other nine bash-bodied steps declares shell: 'bash' individually. This one arrived without it, so on windows-latest the runner wrote the body to a .ps1 file and pwsh rejected line 2 with Missing '(' after 'if' in if statement. The job died in 56 s at step 11 of 38, every later step was skipped, and v0.24.2 published no Windows artifact while macOS arm64, macOS x64 and Linux x64 all succeeded.

Nothing has touched the file since, so the daily packaging check has been red on Windows two days running (09-20 and 09-21), and v0.24.3 was cut today — the next desktop release fails the same way.

Reviewer Test Plan

How to verify

  1. Read the failing log: run 35616657702 → Build Windows x64. It shows shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'", then ParserError: ...ps1:2, then exit code 1 at step 11.
  2. In that same job on that same runner, eight earlier steps completed successfully under C:\Program Files\Git\bin\bash.EXE --noprofile --norc -e -o pipefail {0} — precisely the ones that declare shell: 'bash'. Git Bash is present, so the declaration is the only thing missing.
  3. After merge: re-dispatch desktop-packaging-check.yml (or wait for the 16:00 UTC daily) and confirm Build Windows x64 gets past step 11 and reaches Smoke packaged application.

Evidence (Before & After)

Before, verbatim from the run above:

##[group]Run if [ -f pnpm-lock.yaml ]; then
shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
ParserError: D:\a\_temp\33b4c2f7-5b4f-4e61-a80a-971e51d35e67.ps1:2
   2 |  if [ -f pnpm-lock.yaml ]; then
     |    ~
     | Missing '(' after 'if' in if statement.
##[error]Process completed with exit code 1.

After: not observable from a PR, because this workflow runs on workflow_dispatch, on release, and on the daily schedule — not on pull_request. What was checked locally: the file still parses as YAML and has exactly one Install Qwen Code dependencies step, now carrying shell: bash with its bash body intact; prettier reports no formatting change; .yamllint.yml defines no line-length rule for the added comment.

Tested on

OS Status
🍏 macOS N/A — step body unchanged and macOS jobs are already green
🪟 Windows ⚠️ not tested; needs a workflow run, which only happens after merge
🐧 Linux N/A — Linux already defaults to bash

Environment (optional)

N/A.

Risk & Scope

  • Main risk or tradeoff: essentially none. shell: 'bash' on Windows resolves to the Git Bash that eight sibling steps in the same job already use successfully, the step body is untouched, and Linux/macOS behaviour is identical because bash is already their default.
  • Not validated / out of scope: this does not prove the rest of the Windows packaging path works. It has not run past step 11 since 09-20, so steps 12–38 (bundled runtime, tauri build, NSIS installer, packaged smoke) are unexercised and could surface a second, separate failure. The next packaging check will say.
  • Breaking changes / migration notes: none.

Linked Issues

Fixes #12414

中文说明

这个 PR 做了什么

给桌面发布 workflow 的 Install Qwen Code dependencies 这一步声明 shell: 'bash',让 Windows 构建用 Git Bash 跑这一步的 bash 条件语句,而不是交给 pwsh。三行,没有其他改动。

为什么需要

这一步的内容是在 #11859(切 pnpm)时变成 bash 的。这个 workflow 没有 defaults.run 块——ci.yml 有,所以同样那段脚本在那里是安全的——而它其余九个 bash 步骤都是逐个写 shell: 'bash' 的。唯独这一步漏了,于是在 windows-latest 上 runner 把脚本体写进 .ps1 文件,pwsh 在第 2 行报 Missing '(' after 'if' in if statement.,job 在 56 秒、38 步里的第 11 步就死了,后面全部 skipped,v0.24.2 因此没发出 Windows 产物,而 macOS arm64、macOS x64、Linux x64 同一次 run 全绿。

此后没有任何 commit 再动过这个文件,所以每日 packaging check 在 Windows 上已经连红两天(09-20、09-21),而 v0.24.3 今天已经切了——下一次桌面发布会以同样方式失败。

评审测试计划

如何验证

  1. 看失败日志:run 35616657702 → Build Windows x64。里面是 shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'",接着 ParserError: ...ps1:2,然后第 11 步 exit code 1。
  2. 同一个 job、同一台 runner 上,前面有八个步骤是在 C:\Program Files\Git\bin\bash.EXE --noprofile --norc -e -o pipefail {0} 下跑成功的——正是那些写了 shell: 'bash' 的步骤。Git Bash 是存在的,所以缺的只有这个声明。
  3. 合并后:重新 dispatch desktop-packaging-check.yml(或等 16:00 UTC 的定时跑),确认 Build Windows x64 能过第 11 步并跑到 Smoke packaged application。

证据(改动前后)

改动前,逐字摘自上面那次 run:

##[group]Run if [ -f pnpm-lock.yaml ]; then
shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
ParserError: D:\a\_temp\33b4c2f7-5b4f-4e61-a80a-971e51d35e67.ps1:2
   2 |  if [ -f pnpm-lock.yaml ]; then
     |    ~
     | Missing '(' after 'if' in if statement.
##[error]Process completed with exit code 1.

改动后:从 PR 上观察不到,因为这个 workflow 只在 workflow_dispatch、发布和每日定时时跑,不在 pull_request 上跑。本地检查到的是:文件仍能正常解析为 YAML,Install Qwen Code dependencies 只有一处且现在带着 shell: bash、脚本体未变;prettier 无格式改动;.yamllint.yml 没有对新增注释构成限制的行长规则。

测试平台

OS Status
🍏 macOS N/A——脚本体未变,macOS 两个 job 本来就是绿的
🪟 Windows ⚠️ 未测试;需要一次 workflow run,而它只能在合并后发生
🐧 Linux N/A——Linux 本来默认就是 bash

环境(可选)

N/A。

风险与范围

  • 主要风险/取舍:基本没有。Windows 上的 shell: 'bash' 解析到的就是同一个 job 里八个兄弟步骤已经在成功使用的 Git Bash;脚本体一个字没动;Linux/macOS 行为不变,因为它们本来就默认 bash。
  • 未验证/范围外:这并不能证明 Windows 打包链路的其余部分是好的。自 09-20 起它就没跑过第 11 步,所以第 12–38 步(打包 runtime、tauri build、NSIS 安装器、打包后 smoke)从未被执行,可能还藏着第二个独立故障。下一次 packaging check 会给出答案。
  • 破坏性变更/迁移说明:无。

关联 Issue

Fixes #12414

…ndows

The step body is a bash conditional, but this workflow has no defaults.run
block and the step declared no shell, so windows-latest handed it to pwsh and
died with "Missing '(' after 'if'" before npm or pnpm ran. Every later step
skipped, which is why v0.24.2 published no Windows artifact while macOS and
Linux went green.

The nine other bash-bodied steps in this file already declare shell: 'bash'.
This one arrived with the pnpm switch in #11859 and missed it; ci.yml carries
the same snippet safely because it sets defaults.run.shell at workflow level.

Fixes #12414
@github-actions github-actions Bot added the review/self-reported The linked issue was opened by the PR author (self-reported) label Sep 21, 2026
@yiliang114

Copy link
Copy Markdown
Collaborator Author

Superseded — closing.

#12400 (refactor(build,release): Use pnpm workspace builds and publishing) landed on main while this was being prepared and adds the same shell: 'bash' to this exact step, so this PR now conflicts and contributes nothing.

For the record, the diagnosis in #12414 is confirmed by the logs. Run 35616657702 died at step 11 with shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'" and ParserError: ...ps1:2 — Missing '(' after 'if' in if statement., while eight earlier steps in the same job completed under C:\Program Files\Git\bin\bash.EXE --noprofile --norc -e -o pipefail {0} — exactly the ones that declare shell: 'bash'.

I also swept the rest of desktop-release.yml at current main for the same class (a bash-bodied run: with no shell: in a job that can land on a Windows runner) and found none: the remaining shell-less bash steps are either guarded by if: runner.os == 'Linux' or run on ubuntu-latest.

What to watch next: the daily packaging check at 16:00 UTC should now take Build Windows x64 past step 11. Steps 12–38 (bundled runtime, tauri build, NSIS installer, packaged smoke) have not executed on Windows since 09-20, so a second, unrelated failure there is still possible — that gate is what will say.

@yiliang114 yiliang114 closed this Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review/self-reported The linked issue was opened by the PR author (self-reported)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci(desktop-release): the Windows build runs a bash install step under pwsh, so v0.24.2 published no Windows artifact

1 participant