Scripts: allow smoke artifacts in source log directory #2651

Open
github-bot wants to merge 1 commit from github-bot/gh-2651 into main AGit
Owner

@⁠luckyteagirl on GitHub · 2026-11-26 05:04 UTC · original
luckyteagirl:codex/smoke-in-place-artifacts → main · +25 −4 · 2 files · 1 commits · open

smoke.ps1 -OutDir fails when the destination is the title's own log directory: copying xcl.log or report.json onto itself throws before the manifest and smoke report are produced. Normalize the destination directory and leave in-place artifacts where they are.

What is in it

  • Skip copies when the source and destination names resolve to the same ordinary full path, including case variants on standard Windows directories.
  • Add an in-place artifact fixture, including destinations spelled with . and different casing; confirm the original log/report remain intact and the manifest and smoke block are emitted.

Tested

  • On current main b49be183, the original in-place fixture failed with a self-copy error. The case-variant fixture reproduced the reviewer's self-copy failure in Windows PowerShell 5.1 before the follow-up fix. PowerShell 7 normalized the path casing in that fixture. With this patch, scripts/test-smoke-artifacts.tests.ps1 and the existing scripts/smoke-title.tests.ps1 passed in both Windows PowerShell 5.1 and PowerShell 7.
  • git diff --check passed.

Regression run

  • Not applicable. Only the PowerShell smoke helper and its fixture changed; no runtime code changed.

Not tested

  • A retail title smoke pair, GPU/Rust tests, junction aliases, and directories explicitly configured for case-sensitive lookup. An -OutDir junction targeting the log directory can still cause a self-copy; this patch handles ordinary Windows paths.

AI use

  • Codex (GPT-6.2 Sol) implemented and tested the change; Codex independently reviewed it and prepared this description.
**@⁠luckyteagirl** on GitHub · 2026-11-26 05:04 UTC · [original](https://github.com/xcl-dev/xcl/pull/2651) `luckyteagirl:codex/smoke-in-place-artifacts` → `main` · +25 −4 · 2 files · 1 commits · open `smoke.ps1 -OutDir` fails when the destination is the title's own log directory: copying `xcl.log` or `report.json` onto itself throws before the manifest and smoke report are produced. Normalize the destination directory and leave in-place artifacts where they are. **What is in it** - Skip copies when the source and destination names resolve to the same ordinary full path, including case variants on standard Windows directories. - Add an in-place artifact fixture, including destinations spelled with `.` and different casing; confirm the original log/report remain intact and the manifest and smoke block are emitted. **Tested** - On current main `b49be183`, the original in-place fixture failed with a self-copy error. The case-variant fixture reproduced the reviewer's self-copy failure in Windows PowerShell 5.1 before the follow-up fix. PowerShell 7 normalized the path casing in that fixture. With this patch, `scripts/test-smoke-artifacts.tests.ps1` and the existing `scripts/smoke-title.tests.ps1` passed in both Windows PowerShell 5.1 and PowerShell 7. - `git diff --check` passed. **Regression run** - Not applicable. Only the PowerShell smoke helper and its fixture changed; no runtime code changed. **Not tested** - A retail title smoke pair, GPU/Rust tests, junction aliases, and directories explicitly configured for case-sensitive lookup. An `-OutDir` junction targeting the log directory can still cause a self-copy; this patch handles ordinary Windows paths. **AI use** - Codex (GPT-6.2 Sol) implemented and tested the change; Codex independently reviewed it and prepared this description.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 06:14:36 +00:00
Author
Owner

@⁠KDenKC on GitHub · 2026-11-26 06:44 UTC · original

Small one at 28e26958: the self-copy guards (smoke.ps1:99 and :104) compare with -cne, which is case-sensitive, but NTFS paths are not. (Get-Item).FullName keeps the casing it was given, so -OutDir d:\xcl\logs against a log at D:\XCL\logs\xcl.log counts as two files, and Copy-Item then stops with "Cannot overwrite the item … with itself".

Reproduced on Windows 11 (Windows PowerShell 5.1): a file in %TEMP%\XcLcAsE, with the destination built from the lower-cased directory, gives -cne True and that Copy-Item error. -ne (case-insensitive, like the file system) avoids it.

AI use: Gemini (Antigravity) spotted it in a review; Claude Code (Claude Opus 5.5) reproduced it and wrote this.

**@⁠KDenKC** on GitHub · 2026-11-26 06:44 UTC · [original](https://github.com/xcl-dev/xcl/pull/2651#issuecomment-7184742453) Small one at `28e26958`: the self-copy guards (`smoke.ps1:99` and `:104`) compare with `-cne`, which is case-sensitive, but NTFS paths are not. `(Get-Item).FullName` keeps the casing it was given, so `-OutDir d:\xcl\logs` against a log at `D:\XCL\logs\xcl.log` counts as two files, and `Copy-Item` then stops with "Cannot overwrite the item … with itself". Reproduced on Windows 11 (Windows PowerShell 5.1): a file in `%TEMP%\XcLcAsE`, with the destination built from the lower-cased directory, gives `-cne` True and that `Copy-Item` error. `-ne` (case-insensitive, like the file system) avoids it. AI use: Gemini (Antigravity) spotted it in a review; Claude Code (Claude Opus 5.5) reproduced it and wrote this.
github-bot force-pushed github-bot/gh-2651 from 28e26958a1 to 382a161b3e 2026-11-26 08:35:37 +00:00 Compare
Author
Owner

@⁠luckyteagirl on GitHub · 2026-11-26 08:34 UTC · original

Thanks for the reproducible case. I updated the PR to 382a161b: both in-place copy guards now compare ordinary Windows paths with StringComparison.OrdinalIgnoreCase, and the artifact fixture exercises -OutDir with different casing as well as .. The case-variant fixture reproduced the self-copy error before the fix in Windows PowerShell 5.1; after the fix, the artifact and title smoke script tests pass in both PowerShell 5.1 and 7. The PR description records the remaining junction and explicitly case-sensitive-directory limitations. Windows no-GPU CI is rerunning on the updated head.

AI use: GPT-6.2 Sol implemented and tested the follow-up; GPT-6.2 Astra reviewed the diff and report.

**@⁠luckyteagirl** on GitHub · 2026-11-26 08:34 UTC · [original](https://github.com/xcl-dev/xcl/pull/2651#issuecomment-7186768111) Thanks for the reproducible case. I updated the PR to `382a161b`: both in-place copy guards now compare ordinary Windows paths with `StringComparison.OrdinalIgnoreCase`, and the artifact fixture exercises `-OutDir` with different casing as well as `.`. The case-variant fixture reproduced the self-copy error before the fix in Windows PowerShell 5.1; after the fix, the artifact and title smoke script tests pass in both PowerShell 5.1 and 7. The PR description records the remaining junction and explicitly case-sensitive-directory limitations. Windows no-GPU CI is rerunning on the updated head. AI use: GPT-6.2 Sol implemented and tested the follow-up; GPT-6.2 Astra reviewed the diff and report.
Author
Owner

@⁠KDenKC on GitHub · 2026-11-26 16:31 UTC · original

Checked at 382a161b: both self-copy guards now compare with [StringComparison]::OrdinalIgnoreCase (smoke.ps1:99, :104). Thanks @⁠luckyteagirl.

AI use: Claude Code (Claude Opus 5.5) checked the source at that head and wrote this.

**@⁠KDenKC** on GitHub · 2026-11-26 16:31 UTC · [original](https://github.com/xcl-dev/xcl/pull/2651#issuecomment-7197766226) Checked at `382a161b`: both self-copy guards now compare with `[StringComparison]::OrdinalIgnoreCase` (`smoke.ps1:99`, `:104`). Thanks @⁠luckyteagirl. AI use: Claude Code (Claude Opus 5.5) checked the source at that head and wrote this.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2651/head:github-bot/gh-2651'
git switch 'github-bot/gh-2651'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2651'
git switch 'github-bot/gh-2651'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2651'
git switch 'github-bot/gh-2651'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2651'
git switch 'main'
git merge --squash 'github-bot/gh-2651'
git switch 'main'
git merge --ff-only 'github-bot/gh-2651'
git switch 'main'
git merge 'github-bot/gh-2651'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.