Skip to content

file_system_test: a refused delete keeps the host's attributes, not the ones set - #6861

Merged
shayderrr merged 1 commit into
ItsNotRexed:mainfrom
GeremC:wine9-fs-refused-delete-attrs
Nov 23, 2026
Merged

shayderrr merged 1 commit into
ItsNotRexed:mainfrom
GeremC:wine9-fs-refused-delete-attrs

Conversation

@GeremC

@GeremC GeremC commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Item: new TEST item claimed in #6750 (claim).

What: under Wine 9.0 (the wine package of Ubuntu 24.04 LTS) file_system fails 10 times on "a refused delete retains the visible attributes", once for each read-only DeleteFileW/DeleteFileA case. The shim is right; the test compares with the constant it set instead of with the host. Measured values:

case GAME: file expected (constant) native control file
package-readonly, normal-package-readonly-overlay, readonly-package-readonly-overlay 0x21 0x1 0x21
package-mixed-readonly, normal-package-mixed-readonly-overlay 0x21 0x27 0x21

Wine 9 reads a read-only file back as READONLY|ARCHIVE, and without its xattr support it keeps neither HIDDEN nor SYSTEM. The native control file sits next to the GAME: one, gets the same SetFileAttributesW and is refused the same delete, and it reads back the same 0x21.

Where: runtime/test/file_system_test.cpp: the check compares the logical file's attributes with GetFileAttributesW of that native control file (and requires it to exist). On Windows that is still exactly the constant, so nothing is loosened there. No shim change.

Tests (Ubuntu 24.04, Wine 9.0 9.0~repack-4build3, NVIDIA RTX 4090, real Wayland display; runtime cross-built with clang-cl/lld-link 19.1.1, xwin 0.10.0, SDK 10.0.26100):

No game files.

AI-assisted (Claude Code, Claude Opus 5.5).

🤖 Generated with Claude Code

https://claude.ai/code/session_014W1f1QexoRrV2Dg68CN4cD

…he ones set

Under Wine 9.0 the ten read-only cases of "a refused delete retains the
visible attributes" failed although the shim was right: GetFileAttributes
on GAME: answered 0x21 where the test expected the constant it had set
(0x1, or 0x27 with HIDDEN|SYSTEM|ARCHIVE). Wine 9 reads a read-only file
back as READONLY|ARCHIVE and keeps neither HIDDEN nor SYSTEM without its
xattr support; the native control file next to it, given the same
attributes and also refused, reads back 0x21 as well.

The check now compares the logical file with that native control file,
which is the host's answer for the same attributes. On Windows that is
still exactly the constant.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014W1f1QexoRrV2Dg68CN4cD
@BeegSchmooze

Copy link
Copy Markdown
Contributor

Native Windows check of 3a301f76 (the regression it fixes is Wine 9 only, so this is the "unchanged on Windows" side): pass. Windows 11 26200, NTFS, MSVC 19.51 (VS 18), RelWithDebInfo.

AI-assisted (Claude Code). No game files.

@dea7hsmiless

Copy link
Copy Markdown
Contributor

Tested 3a301f768 on Windows 11 (build 26300.9974), MSVC 19.44.35229, RelWithDebInfo + Ninja: pass.

  • Build clean.
  • ctest -R "^file_system$" -V: Passed; the verbose output includes PASS a refused delete retains the visible attributes for the read-only cases, so the changed check ran.
  • The new expectation compares against the host file's own attributes (GetFileAttributesW(native_file)), which is the intended native-Windows behavior; this is a Wine 9 expectation fix, and I cannot run Wine 9 on this host. No Windows regression here.
  • Synthetic temp folders only; no game files. AI-assisted (OpenCode).

@shayderrr shayderrr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

runtime/test/file_system_test.cpp changes the read-only overlay attribute assertion to compare the logical path's attributes against GetFileAttributesW on the real native file instead of a fixed expected mask.

Why merge

Windows and Wine 9 report different attribute sets for the same read-only file, so the hardcoded expectation made a correct shim look broken on one host. Comparing against the host's own answer keeps the test meaningful across platforms without weakening what it checks.

Verdict: Approve

@shayderrr

Copy link
Copy Markdown
Collaborator

Summary

runtime/test/file_system_test.cpp changes the read-only overlay attribute assertion to compare the logical path's attributes against GetFileAttributesW on the real native file instead of a fixed expected mask.

Why merge

Windows and Wine 9 report different attribute sets for the same read-only file, so the hardcoded expectation made a correct shim look broken on one host. Comparing against the host's own answer keeps the test meaningful across platforms without weakening what it checks.

Verdict: Approve

@shayderrr
shayderrr merged commit 87c6c2b into ItsNotRexed:main Nov 23, 2026
0 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants