diff --git a/docs/e2e.md b/docs/e2e.md index 4b6338e..1604e85 100644 --- a/docs/e2e.md +++ b/docs/e2e.md @@ -92,12 +92,11 @@ host, so it cannot conflict with a vfox-managed toolchain. The `windows-11-arm` runner has no Windows Hypervisor Platform feature, so Hyper-V isolation is unavailable; process isolation needs only the Containers feature. -The `main` combos run with `VFOX_HOME` pointing inside a path containing a +Every combination runs with `VFOX_HOME` pointing inside a path containing a space (`C:\Users\John Doe\.vfox`), mirroring -[issue #33](https://github.com/version-fox/vfox-flutter/issues/33). Only vfox -`main` carries the fix for such paths -([vfox#712](https://github.com/version-fox/vfox/pull/712)), so `latest` -combinations still run with an unspaced home. +[vfox#723](https://github.com/version-fox/vfox/issues/723). vfox handles such +paths since 1.0.13 ([vfox#712](https://github.com/version-fox/vfox/pull/712)), +so both `latest` and `main` carry the fix. ### x64 diff --git a/docs/ohos.md b/docs/ohos.md index 0a12feb..210845c 100644 --- a/docs/ohos.md +++ b/docs/ohos.md @@ -34,8 +34,6 @@ vfox search flutter - **`linux-arm64` and `windows-arm64`.** Upstream publishes only x64 Dart SDKs, so the first `flutter` run fails there (`It appears that the downloaded file is corrupt`). The ARM64 e2e runs the official flavor only. -- **A Windows home containing a space** (`C:\Users\John Doe\.vfox`) is not supported; - point vfox at a path without spaces with `$env:VFOX_HOME = 'D:\vfox'`. - **The first `flutter` command is slow.** It builds the tool and downloads the Dart SDK from Huawei's OBS, so it needs a network connection. - **No checksum is verified.** Git history is the integrity check, and this is a diff --git a/lib/git.lua b/lib/git.lua index b461537..0aa5070 100644 --- a/lib/git.lua +++ b/lib/git.lua @@ -24,10 +24,10 @@ local GH_BASE = "https://github.com/" local M = {} -- Quote a path for the platform shell. On Windows the shell is cmd.exe: --- vfox main passes the command line through verbatim (the fix for --- version-fox/vfox#712), so a path containing spaces (C:\Users\John +-- vfox 1.0.13 and newer pass the command line through verbatim (the fix +-- for version-fox/vfox#712), so a path containing spaces (C:\Users\John -- Doe\.vfox) is safe in double quotes. Paths that need no quoting stay --- bare: released vfox builds re-quote the command line themselves and +-- bare: vfox 1.0.12 and older re-quote the command line themselves and -- mangle embedded double quotes, and they never supported spaces anyway. local function quote(value) if RUNTIME.osType == "windows" then diff --git a/lib/manifest.lua b/lib/manifest.lua index 31bee1c..1b1378c 100644 --- a/lib/manifest.lua +++ b/lib/manifest.lua @@ -28,10 +28,10 @@ local function joinPath(a, b) end -- Quote a path for the platform shell. On Windows the shell is cmd.exe: --- vfox main passes the command line through verbatim (the fix for --- version-fox/vfox#712), so a path containing spaces (C:\Users\John +-- vfox 1.0.13 and newer pass the command line through verbatim (the fix +-- for version-fox/vfox#712), so a path containing spaces (C:\Users\John -- Doe\.vfox) is safe in double quotes. Paths that need no quoting stay --- bare: released vfox builds re-quote the command line themselves and +-- bare: vfox 1.0.12 and older re-quote the command line themselves and -- mangle embedded double quotes, and they never supported spaces anyway. local function quote(value) if RUNTIME.osType == "windows" then diff --git a/tests/e2e/windows/e2e_test.go b/tests/e2e/windows/e2e_test.go index 9f1429e..ff4f489 100644 --- a/tests/e2e/windows/e2e_test.go +++ b/tests/e2e/windows/e2e_test.go @@ -132,8 +132,8 @@ func buildImage(t *testing.T, ctx context.Context, repoRoot, image, platform, ba // runOne starts one long-lived container per combo and drives the whole // E2E flow (setup -> preflight -> install -> verify) through pwsh exec // calls, asserting in Go. A combo passes when every phase exits 0 and the -// outputs carry the expected markers. vfox main combos run against a -// VFOX_HOME containing a space (see vfoxHome). +// outputs carry the expected markers. Every combo runs against a VFOX_HOME +// containing a space (see spacedVfoxHome). func runOne(t *testing.T, ctx context.Context, image, platform string, c common.Combo) { t.Helper() prefix := c.Prefix(platform) @@ -186,7 +186,7 @@ func runOne(t *testing.T, ctx context.Context, image, platform string, c common. procArch := procArchOfContainer(ctx, t, ctr) t.Logf("=== vfox %s, flutter %s, %s, mirror %s, %s ===", c.Vfox, version, flavor, mirror, procArch) - box := setupSlotEnv(ctx, t, ctr, c.Slug(), c.Vfox) + box := setupSlotEnv(ctx, t, ctr, c.Slug()) checkMirrorReachable(ctx, t, ctr, flavor, mirror) setupVfox(ctx, t, ctr, box, c.Vfox) checkBogusMirrorRejected(ctx, t, ctr, box, flavor, version) diff --git a/tests/e2e/windows/matrix_test.go b/tests/e2e/windows/matrix_test.go index 5a40cf2..3fa1e1c 100644 --- a/tests/e2e/windows/matrix_test.go +++ b/tests/e2e/windows/matrix_test.go @@ -39,18 +39,12 @@ func TestReleasesIndex(t *testing.T) { } } -func TestVfoxHome(t *testing.T) { - profile := `C:\Users\ContainerAdministrator` - if got, want := vfoxHome(profile, "latest-official-default", "latest"), - `C:\Users\ContainerAdministrator\vfox-e2e-runs\latest-official-default\.vfox`; got != want { - t.Errorf("vfoxHome(latest) = %q, want %q", got, want) - } - got := vfoxHome(profile, "main-official-default", "main") - if got != spacedVfoxHome { - t.Errorf("vfoxHome(main) = %q, want %q", got, spacedVfoxHome) - } - if !strings.Contains(got, " ") { - t.Errorf("vfoxHome(main) = %q, want a path containing a space", got) +// The plugin double-quotes Windows paths only when they contain whitespace +// (lib/git.lua, lib/manifest.lua), so the e2e home must keep its space for +// every combo to exercise that branch. +func TestSpacedVfoxHome(t *testing.T) { + if !strings.Contains(spacedVfoxHome, " ") { + t.Errorf("spacedVfoxHome = %q, want a path containing a space", spacedVfoxHome) } } diff --git a/tests/e2e/windows/setup.go b/tests/e2e/windows/setup.go index e5ff48f..1f146cc 100644 --- a/tests/e2e/windows/setup.go +++ b/tests/e2e/windows/setup.go @@ -35,21 +35,13 @@ const ( // spacedVfoxHome is the default vfox home of a Windows account whose // name contains a space, the layout reported in - // https://github.com/version-fox/vfox-flutter/issues/33 . + // https://github.com/version-fox/vfox/issues/723 . Every combo runs + // against it: vfox handles such paths since 1.0.13 + // (https://github.com/version-fox/vfox/pull/712), so both latest and + // main carry the fix. spacedVfoxHome = `C:\Users\John Doe\.vfox` ) -// vfoxHome returns the $VFOX_HOME for a combo. The fix for Windows homes -// containing a space (https://github.com/version-fox/vfox/pull/712) is on -// vfox main only: released builds still fail on such paths, so only main -// runs against spacedVfoxHome while the others keep an unspaced slot home. -func vfoxHome(userProfile, slot, vfoxVersion string) string { - if vfoxVersion == "main" { - return spacedVfoxHome - } - return userProfile + `\vfox-e2e-runs\` + slot + `\.vfox` -} - // pwshQuote renders a single-quoted PowerShell string literal. func pwshQuote(s string) string { return "'" + strings.ReplaceAll(s, "'", "''") + "'" @@ -96,15 +88,15 @@ type slotBox struct { // setupSlotEnv replicates the slot isolation header of setup.ps1: // USERPROFILE/TEMP/TMP point under vfox-e2e-runs\, while VFOX_HOME is -// a sibling .vfox (spacedVfoxHome for main), so parallel combos on one -// daemon never share vfox state. -func setupSlotEnv(ctx context.Context, t *testing.T, ctr tc.Container, slot, vfoxVersion string) slotBox { +// spacedVfoxHome. Each combo runs in its own container, so combos sharing +// that path never share vfox state. +func setupSlotEnv(ctx context.Context, t *testing.T, ctr tc.Container, slot string) slotBox { t.Helper() userProfile := strings.TrimSpace(execOK(ctx, t, ctr, "$env:USERPROFILE")) containerPath := strings.TrimSpace(execOK(ctx, t, ctr, "$env:PATH")) procArch := strings.TrimSpace(execOK(ctx, t, ctr, "$env:PROCESSOR_ARCHITECTURE")) - home := vfoxHome(userProfile, slot, vfoxVersion) + home := spacedVfoxHome box := slotBox{slot: slot} box.slotRoot = userProfile + `\vfox-e2e-runs\` + slot box.tmp = box.slotRoot + `\tmp`