beyond-all-reason / beyond-all-reason/RecoilEngine

Check `VFS.DirList` path slash consistency (incl. for desync)

Open
#139 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
679
Forks
290
Avg merge
3d 2h
Merged PRs (30d)
40

Description

1) Damgam claims that he can sometimes reproduce `VFS.DirList` returning `\` instead of `/` for files (apparently it's for additional read folders outside Spring's normal tree, eg. `C:\My Documents\bla` absolute paths on Windows as opposed to the usual `/bla` relative)
2) It should be possible to make Spring run synced archives from arbitrary paths outside of its dir (via `spring.exe --game=C:\My Documents\bar.sd7`).
3) It looks like nothing blocks such paths ( https://github.com/Beyond-all-Reason/spring/blob/BAR105/rts/Lua/LuaVFS.cpp#L265 looks like it could, though that just blocks absolute paths which may not map 1:1 to slash type)

If you can get a synced callout to return different values depending on platform, that's a ticking desync bomb. I haven't tried reproducing yet but this is may be worth checking at some point.

Different slashes are also an annoyance. It would be good if Spring encapsulated platform differences and guaranteed `/` as dir separator from `VFS.DirList` natively (this would also remove the potential for desync, anyway). This is mostly a low priority request because I haven't yet reproduced the desync and otherwise it's not too impactful.

Contributor guide

Open the contributing guide

Research direction

Start with VFS.DirList and the LuaVFS.cpp code around line 265, then reproduce the reported behavior on Windows and another platform using an external path such as C:\My Documents\bar.sd7. Check whether synced callouts can return platform-dependent slash values and whether arbitrary external archive paths work; done means the behavior is verified and the requested path and separator guarantees are covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, lua
Domain
backend, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.