From 95a21c9ffdbffb00d3e1a9f2c902e90095087f80 Mon Sep 17 00:00:00 2001 From: rebuildup Date: Mon, 30 Nov 2026 14:50:15 +0900 Subject: [PATCH] =?UTF-8?q?fix(#288):=20Windows=20=E3=81=AE=20dotfiles-lin?= =?UTF-8?q?k=20=E5=A4=B1=E6=95=97=E3=82=92=20error=20=E3=81=AB=E3=81=9B?= =?UTF-8?q?=E3=81=9A=20pending=20=E3=81=AB=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Windows native の dotfiles symlink はまだ canonical ではなく、user-level の agent 設定は WSL 側が canonical である (platforms/windows-11/README.md)。 それでも `dotfiles-link` step は失敗を error として記録し、毎時 converge が exit 1 になっていた。 実機では dotfiles 側の `script/link.ps1` が param block の default で `$PSScriptRoot` を使い、Windows PowerShell 5.1 では param 評価時に空になる ため `Split-Path` が失敗する (PowerShell 7 では解決される)。dotfiles 側の 修正は rebuildup/dotfiles で行うが、pc-setup 側でも「native link が未 canonical である」以上、link の失敗で machine convergence を失敗させない。 - `dotfiles-link` の失敗を pending として記録する (終了コード 3)。 - link script 自体が無い場合も pending とする。 - CI に回帰防止の check を追加。 Co-Authored-By: Claude Code --- .github/workflows/ci.yml | 18 ++++++++++++++++++ platforms/windows-11/converge.ps1 | 9 +++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 07241e15..db8885d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -751,6 +751,24 @@ jobs: throw 'converge.ps1 must run user-path.ps1 as a named step.' } + # Native Windows dotfiles linking is not canonical yet: the user-level + # agent configuration is owned by the WSL side until the Windows link + # adapter is enabled. A failing link step must not fail the machine + # convergence. + - name: Validate the Windows dotfiles link step stays non-fatal + shell: pwsh + run: | + Set-StrictMode -Version Latest + $ErrorActionPreference = 'Stop' + + $converge = Get-Content -LiteralPath ./platforms/windows-11/converge.ps1 -Raw + if ($converge -notmatch "Add-Step 'dotfiles-link' 'pending'") { + throw 'the Windows dotfiles link step must be recorded as pending, not as an error.' + } + if ($converge -match "Add-Step 'dotfiles-link' 'error'") { + throw 'the Windows dotfiles link step must not be recorded as an error.' + } + - name: Validate converge survives a step error and always reports shell: pwsh run: | diff --git a/platforms/windows-11/converge.ps1 b/platforms/windows-11/converge.ps1 index 0f5bb5d9..2d2c42ff 100644 --- a/platforms/windows-11/converge.ps1 +++ b/platforms/windows-11/converge.ps1 @@ -284,7 +284,7 @@ function Invoke-DotfilesSync { } $link = Join-Path (Join-Path $DotfilesDir 'script') 'link.ps1' if (-not (Test-Path -LiteralPath $link)) { - Add-Step 'dotfiles-link' 'error' ($link + ' is missing') + Add-Step 'dotfiles-link' 'pending' ($link + ' is missing; native Windows dotfiles linking is not canonical yet') return } # -Apply is adoption-first in link.ps1: it creates absent links and never @@ -302,7 +302,12 @@ function Invoke-DotfilesSync { $why = '; ' + ([string]$conflict[0]).Trim() if ($why.Length -gt 200) { $why = $why.Substring(0, 200) } } - Add-Step 'dotfiles-link' 'error' ('link.ps1 exited ' + $LASTEXITCODE + $why + '; see ' + $script:LogFile) + # Native Windows dotfiles linking is not canonical yet: the user-level + # agent configuration is owned by the WSL side until the Windows link + # adapter is enabled (platforms/windows-11/README.md). A failure here is + # therefore recorded as pending instead of failing the machine + # convergence (rebuildup/pc-setup#288). + Add-Step 'dotfiles-link' 'pending' ('link.ps1 exited ' + $LASTEXITCODE + $why + '; native Windows dotfiles linking is not canonical yet; see ' + $script:LogFile) } }