Skip to content

Enable CASC and MPQ reading on Linux - #45

Merged
mapron merged 3 commits into
mapron:mainfrom
leduythuccs:linux-core
Nov 11, 2026
Merged

mapron merged 3 commits into
mapron:mainfrom
leduythuccs:linux-core

Conversation

@leduythuccs

@leduythuccs leduythuccs commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

First step for #40: makes the native Linux build able to generate a D2R mod from a game install. This covers core only CASC/MPQ, no UI change yet.

Changes

  • Pass path.native() to CascLib/StormLib instead of .wstring(). It matches TCHAR on each platform and is unchanged on Windows.
  • FolderStorage: convert \ to / in storage-relative paths.

Testing

Linux, D2R build 95032 installed through Proton:

  • Generated a mod from modgen_ui, mod loadded
  • Windows build: -> pipeline passed

Known issues on Linux

The UI still assumes Windows in places, so until the follow-up PR:

  • All of Extra tab feature is not working, except for changing Mod id
  • All Browse folder/file config drop the leading /, could be solve by typing by hand

The second issue is easy to fix, the Extra tab is harder, as i stated in this comment

Next step

  • Figure out how to migrate the Extra tab to linux. I think it's easy for the most part, except for the generating .desktop file

- Pass native paths to CascLib/StormLib instead of wide strings
- FolderStorage: convert backslashes in paths
Comment thread src/CoreLib/Storage/FolderStorage.cpp Resolved
Comment thread src/CoreLib/Storage/StormStorage.cpp Resolved
Comment thread cmake/StormLib.cmake Resolved
@mapron

mapron commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

I approved pipeline for Github Actions or in worse case I fix windows build myself, if you break it. LGTM to me should not break anything.

@leduythuccs

Copy link
Copy Markdown
Collaborator Author

Fixed the CMake. The make_preferred didn't work so I leave it as it is

Move the path convert to `readFile/writeFile/createDirectories`. So caller doesn't need to do it
@mapron

mapron commented Nov 11, 2026

Copy link
Copy Markdown
Owner

I wish we have some unit-test with small test mpq with one file so it runs on CI and I never break it on accident. With CASC , well, no easy way (we can make test casc I guess to but it will make so maby files in git, don't wanna.

@leduythuccs

Copy link
Copy Markdown
Collaborator Author

I updated the path helper, instead of doing in in caller (which is very easy to forgot), i put it in the readFile WriteFile createDirectories functions

@mapron
mapron merged commit 9d951d5 into mapron:main Nov 11, 2026
2 checks passed
@leduythuccs

Copy link
Copy Markdown
Collaborator Author

I wish we have some unit-test with small test mpq with one file so it runs on CI and I never break it on accident. With CASC , well, no easy way (we can make test casc I guess to but it will make so maby files in git, don't wanna.

In my local I actually asked Claude to make a hook, to generate a mod after each change, and the result should be byte-identical to the window build (that i run in wine)

@mapron

mapron commented Nov 11, 2026

Copy link
Copy Markdown
Owner

Today I learned github merges BEFORE CI finishes, darn. I did get github action on prev commit, not a big deal but now I know. So get used to it.

@leduythuccs
leduythuccs deleted the linux-core branch November 11, 2026 02:58
@mapron

mapron commented Nov 11, 2026

Copy link
Copy Markdown
Owner

"In my local I actually asked Claude to make a hook, to generate a mod after each change, and the result should be byte-identical to the window build (that i run in wine)"

not a great unit-test idea. I was talking about change set sustainability.

Thanks for contribution, but I will still despise heavy AI usage. Please do more yourself later.

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.

2 participants